﻿Imports System
Imports System.Attribute
Imports System.Collections
Imports System.Collections.Generic
Imports System.Collections.ObjectModel
Imports System.Globalization
Imports System.IO
Imports System.IO.Stream
Imports System.Reflection
Imports System.Runtime.InteropServices
Imports System.Runtime.Serialization
Imports System.Security.Cryptography.HashAlgorithm
Imports System.Threading

Namespace sl3core
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	<StructLayout(LayoutKind.Sequential)> _
	 Friend Structure PendingOperation
		Public Async As XOverlappedAsyncResult
		Public Callback As AsyncCallback
		Public Sub New(ByVal _async As XOverlappedAsyncResult, ByVal _callback As AsyncCallback)
			Me.Async = _async
			Me.Callback = _callback
		End Sub
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	<StructLayout(LayoutKind.Sequential)> _
  Friend Structure NativeToManagedCallback
		Public originalWaitHandle As Nullable(Of Boolean)
		Public dupedWaitHandle As Nullable(Of Boolean)
		Friend Delegate Function eventSignalledFunction(ByVal param1 As Nullable(Of Boolean), ByVal param2 As Nullable(Of Boolean), ByVal callType As ManagedCallType, ByVal num As UInt32, ByVal cond As Boolean) As Integer
		Public pContext As Nullable(Of Boolean)

		Public Sub New(ByVal origHandle As Nullable(Of Boolean), ByRef dupedHandle As Nullable(Of Boolean), ByVal [function] As eventSignalledFunction, ByRef context As Nullable(Of Boolean))
			Me.originalWaitHandle = origHandle
			Me.dupedWaitHandle = dupedHandle
			Me.eventSignalledFunction = [function]
			Me.pContext = context
		End Sub
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	<StructLayout(LayoutKind.Sequential, Size:=1)> _
	 Friend Structure InternalIndexComparer(Of T As Gamer)
		Implements IComparer(Of T)

		Public Function Compare(ByVal x As T, ByVal y As T) As Integer Implements System.Collections.Generic.IComparer(Of T).Compare
			Return x.InternalIndex.CompareTo(y.InternalIndex)
		End Function
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure Alpha8
		Implements IPackedVector(Of Byte), IEquatable(Of Alpha8)

		Private _packedvalue As Single
#Region "Constructors"
		Public Sub New(ByVal alpha As Single)
			_packedvalue = alpha
		End Sub
#End Region
#Region "Methods"
		Public Sub PackFromVector4(ByRef v1 As Vector4) Implements IPackedVector.PackFromVector4

		End Sub
#End Region
#Region "Functions"
		Public Function ToAlpha() As Single

		End Function
		Public Function ToVector4() As Vector4 Implements IPackedVector.ToVector4

		End Function
		Private Function Alpha8Equals(ByVal other As Alpha8) As Boolean Implements System.IEquatable(Of Alpha8).Equals
			Return Me.Equals(other)
		End Function
#End Region
#Region "Properties"
		Public Property PackedValue() As Byte Implements IPackedVector(Of Byte).PackedValue
			Get
				Return CByte(_packedvalue)
			End Get
			Set(ByVal value As Byte)

			End Set
		End Property
#End Region
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure Bgr565
		Implements IPackedVector(Of UInteger), IEquatable(Of Bgr565)

#Region "Constructor"
		Public Sub New(ByVal x As Single, ByVal y As Single, ByVal z As Single)

		End Sub
		Public Sub New(ByVal v1 As Vector3)

		End Sub
#End Region
#Region "Properties"
		Public Property PackedValue() As UInteger Implements IPackedVector(Of UInteger).PackedValue
			Get

			End Get
			Set(ByVal value As UInteger)

			End Set
		End Property
#End Region
#Region "Methods"
		Public Sub PackFromVector4(ByRef v1 As Vector4) Implements IPackedVector.PackFromVector4

		End Sub
#End Region
#Region "Functions"
		Private Overloads Function Equals(ByVal other As Bgr565) As Boolean Implements System.IEquatable(Of Bgr565).Equals

		End Function
		Public Function ToVector3() As Vector3

		End Function
		Public Function ToVector4() As Vector4 Implements IPackedVector.ToVector4

		End Function
#End Region
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure Bgra5551

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure Byte4

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure HalfSingle

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure HalfVector2

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure HalfVector4

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure Normalized101010

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure NormalizedByte2

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure NormalizedByte4

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure NormalizedShort2

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure NormalizedShort4

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure Rg32

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure Rgba64

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure Short2

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure Short4

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <typeparam name="T"></typeparam>
	''' <remarks></remarks>
	Public Structure UInt101010

	End Structure

End Namespace
Namespace sl3graphics
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure Color
		Implements IPackedVector(Of UInt32), IPackedVector, IEquatable(Of Color)


#Region "Private Variables"
		Private _red As Byte
		Private _blue As Byte
		Private _green As Byte
		Private _alpha As Byte
		Private _packedValue As UInt32
#End Region
#Region "Constructors"
		''' <summary>
		''' needs coding
		''' </summary>
		''' <param name="packedValue"></param>
		''' <remarks></remarks>
		Private Sub New(ByVal packedValue As UInt32)

		End Sub
		''' <summary>
		''' needs coding
		''' </summary>
		''' <param name="r"></param>
		''' <param name="g"></param>
		''' <param name="b"></param>
		''' <remarks></remarks>
		Public Sub New(ByVal r As Byte, ByVal g As Byte, ByVal b As Byte)

		End Sub
		''' <summary>
		''' needs coding
		''' </summary>
		''' <param name="r"></param>
		''' <param name="g"></param>
		''' <param name="b"></param>
		''' <param name="a"></param>
		''' <remarks></remarks>
		Public Sub New(ByVal r As Byte, ByVal g As Byte, ByVal b As Byte, ByVal a As Byte)

		End Sub
		''' <summary>
		''' needs coding
		''' </summary>
		''' <param name="r"></param>
		''' <param name="g"></param>
		''' <param name="b"></param>
		''' <remarks></remarks>
		Public Sub New(ByVal r As Single, ByVal g As signle, ByVal b As Single)

		End Sub
		''' <summary>
		''' needs coding
		''' </summary>
		''' <param name="r"></param>
		''' <param name="g"></param>
		''' <param name="b"></param>
		''' <param name="a"></param>
		''' <remarks></remarks>
		Public Sub New(ByVal r As Single, ByVal g As Single, ByVal b As Single, ByVal a As Single)

		End Sub
		''' <summary>
		''' needs coding
		''' </summary>
		''' <param name="v1"></param>
		''' <remarks></remarks>
		Public Sub New(ByVal v1 As Vector3)

		End Sub
		''' <summary>
		''' needs coding
		''' </summary>
		''' <param name="v1"></param>
		''' <remarks></remarks>
		Public Sub New(ByVal v1 As Vector4)

		End Sub
		''' <summary>
		''' needs coding
		''' </summary>
		''' <param name="rgb"></param>
		''' <param name="a"></param>
		''' <remarks></remarks>
		Public Sub New(ByVal rgb As Color, ByVal a As Byte)

		End Sub
		''' <summary>
		''' needs coding
		''' </summary>
		''' <param name="rgb"></param>
		''' <param name="a"></param>
		''' <remarks></remarks>
		Public Sub New(ByVal rgb As Color, ByVal a As Single)

		End Sub
#End Region
#Region "Properties"
		''' <summary>
		''' Gets or Sets the Alpha value of a color
		''' </summary>
		''' <value>Byte value, representing the Alpha color</value>
		''' <returns>Byte value, representing the Alpha color</returns>
		''' <remarks></remarks>
		Public Property A() As Byte
			Get
				Return _alpha
			End Get
			Set(ByVal value As Byte)
				_alpha = value
			End Set
		End Property
		''' <summary>
		''' Gets or Sets the Blue value of a color
		''' </summary>
		''' <value>Byte value, representing the Blue color portion.</value>
		''' <returns>Byte value, representing the Blue color portion</returns>
		''' <remarks></remarks>
		Public Property B() As Byte
			Get
				Return _blue
			End Get
			Set(ByVal value As Byte)
				_blue = value
			End Set
		End Property
		''' <summary>
		''' Gets or Sets the Green value of a color
		''' </summary>
		''' <value>Byte value, representing the Green color portion</value>
		''' <returns>Byte value, representing the Green color portion</returns>
		''' <remarks></remarks>
		Public Property G() As Byte
			Get
				Return _green
			End Get
			Set(ByVal value As Byte)
				_green = value
			End Set
		End Property
		''' <summary>
		''' Gets or Sets the Red value of a color
		''' </summary>
		''' <value>Byte value, representing the Red color portion</value>
		''' <returns>Byte value, representing the Red color portion</returns>
		''' <remarks></remarks>
		Public Property R() As Byte
			Get
				Return _red
			End Get
			Set(ByVal value As Byte)
				_red = value
			End Set
		End Property

		Shared ReadOnly Property AliceBlue() As Color
			Get
				Return New Color(240, 248, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property AntiqueWhite() As Color
			Get
				Return New Color(250, 235, 215, 255)
			End Get
		End Property
		Shared ReadOnly Property Aqua() As Color
			Get
				Return New Color(0, 255, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property Aquamarine() As Color
			Get
				Return New Color(127, 255, 212, 255)
			End Get
		End Property
		Shared ReadOnly Property Azure() As Color
			Get
				Return New Color(240, 255, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property Beige() As Color
			Get
				Return New Color(245, 245, 220, 255)
			End Get
		End Property
		Shared ReadOnly Property Bisque() As Color
			Get
				Return New Color(255, 228, 196, 255)
			End Get
		End Property
		Shared ReadOnly Property Black() As Color
			Get
				Return New Color(0, 0, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property BlanchedAlmond() As Color
			Get
				Return New Color(255, 235, 205, 255)
			End Get
		End Property
		Shared ReadOnly Property Blue() As Color
			Get
				Return New Color(0, 0, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property BlueViolet() As Color
			Get
				Return New Color(138, 43, 226, 255)
			End Get
		End Property
		Shared ReadOnly Property Brown() As Color
			Get
				Return New Color(165, 42, 42, 255)
			End Get
		End Property
		Shared ReadOnly Property BurlyWood() As Color
			Get
				Return New Color(222, 184, 135, 255)
			End Get
		End Property
		Shared ReadOnly Property CadetBlue() As Color
			Get
				Return New Color(95, 158, 160, 255)
			End Get
		End Property
		Shared ReadOnly Property Chartreuse() As Color
			Get
				Return New Color(127, 255, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property Chocolate() As Color
			Get
				Return New Color(210, 105, 30, 255)
			End Get
		End Property
		Shared ReadOnly Property Coral() As Color
			Get
				Return New Color(255, 127, 80, 255)
			End Get
		End Property
		Shared ReadOnly Property CornflowerBlue() As Color
			Get
				Return New Color(100, 149, 237, 255)
			End Get
		End Property
		Shared ReadOnly Property Cornsilk() As Color
			Get
				Return New Color(255, 248, 220, 255)
			End Get
		End Property
		Shared ReadOnly Property Crimson() As Color
			Get
				Return New Color(220, 20, 60, 255)
			End Get
		End Property
		Shared ReadOnly Property Cyan() As Color
			Get
				Return New Color(0, 255, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkBlue() As Color
			Get
				Return New Color(0, 0, 139, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkCyan() As Color
			Get
				Return New Color(0, 139, 139, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkGoldenrod() As Color
			Get
				Return New Color(184, 134, 11, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkGray() As Color
			Get
				Return New Color(169, 169, 169, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkGreen() As Color
			Get
				Return New Color(0, 100, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkKhaki() As Color
			Get
				Return New Color(189, 183, 107, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkMagenta() As Color
			Get
				Return New Color(139, 0, 139, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkOliveGreen() As Color
			Get
				Return New Color(85, 107, 47, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkOrange() As Color
			Get
				Return New Color(255, 140, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkOrchid() As Color
			Get
				Return New Color(153, 50, 204, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkRed() As Color
			Get
				Return New Color(139, 0, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkSalmon() As Color
			Get
				Return New Color(233, 150, 122, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkSeaGreen() As Color
			Get
				Return New Color(143, 188, 139, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkSlateBlue() As Color
			Get
				Return New Color(72, 61, 139, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkSlateGray() As Color
			Get
				Return New Color(47, 79, 79, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkTurquoise() As Color
			Get
				Return New Color(0, 206, 209, 255)
			End Get
		End Property
		Shared ReadOnly Property DarkViolet() As Color
			Get
				Return New Color(148, 0, 211, 255)
			End Get
		End Property
		Shared ReadOnly Property DeepPink() As Color
			Get
				Return New Color(255, 20, 147, 255)
			End Get
		End Property
		Shared ReadOnly Property DeepSkyBlue() As Color
			Get
				Return New Color(0, 191, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property DimGray() As Color
			Get
				Return New Color(105, 105, 105, 255)
			End Get
		End Property
		Shared ReadOnly Property DodgerBlue() As Color
			Get
				Return New Color(30, 144, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property Firebrick() As Color
			Get
				Return New Color(178, 34, 34, 255)
			End Get
		End Property
		Shared ReadOnly Property FloralWhite() As Color
			Get
				Return New Color(255, 250, 240, 255)
			End Get
		End Property
		Shared ReadOnly Property ForestGreen() As Color
			Get
				Return New Color(34, 139, 34, 255)
			End Get
		End Property
		Shared ReadOnly Property Fuchsia() As Color
			Get
				Return New Color(255, 0, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property Greensboro() As Color
			Get
				Return New Color(220, 220, 220, 255)
			End Get
		End Property
		Shared ReadOnly Property GhostWhite() As Color
			Get
				Return New Color(248, 248, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property Gold() As Color
			Get
				Return New Color(255, 215, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property Goldenrod() As Color
			Get
				Return New Color(218, 165, 32, 255)
			End Get
		End Property
		Shared ReadOnly Property Gray() As Color
			Get
				Return New Color(128, 128, 128, 255)
			End Get
		End Property
		Shared ReadOnly Property Green() As Color
			Get
				Return New Color(0, 128, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property GreenYellow() As Color
			Get
				Return New Color(173, 255, 47, 255)
			End Get
		End Property
		Shared ReadOnly Property Honeydew() As Color
			Get
				Return New Color(240, 255, 240, 255)
			End Get
		End Property
		Shared ReadOnly Property HotPink() As Color
			Get
				Return New Color(255, 105, 180, 255)
			End Get
		End Property
		Shared ReadOnly Property IndianRed() As Color
			Get
				Return New Color(205, 92, 92, 255)
			End Get
		End Property
		Shared ReadOnly Property Indigo() As Color
			Get
				Return New Color(75, 0, 130, 255)
			End Get
		End Property
		Shared ReadOnly Property Ivory() As Color
			Get
				Return New Color(255, 255, 240, 255)
			End Get
		End Property
		Shared ReadOnly Property Khaki() As Color
			Get
				Return New Color(240, 230, 140, 255)
			End Get
		End Property
		Shared ReadOnly Property Lavender() As Color
			Get
				Return New Color(230, 230, 250, 255)
			End Get
		End Property
		Shared ReadOnly Property LavenderBlush() As Color
			Get
				Return New Color(255, 240, 245, 255)
			End Get
		End Property
		Shared ReadOnly Property LawnGreen() As Color
			Get
				Return New Color(124, 252, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property LemonChiffon() As Color
			Get
				Return New Color(255, 250, 205, 255)
			End Get
		End Property
		Shared ReadOnly Property LightBlue() As Color
			Get
				Return New Color(173, 216, 230, 255)
			End Get
		End Property
		Shared ReadOnly Property LightCoral() As Color
			Get
				Return New Color(240, 128, 128, 255)
			End Get
		End Property
		Shared ReadOnly Property LightCyan() As Color
			Get
				Return New Color(224, 255, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property LightGoldenrodYellow() As Color
			Get
				Return New Color(250, 250, 210, 255)
			End Get
		End Property
		Shared ReadOnly Property LightGray() As Color
			Get
				Return New Color(211, 211, 211, 255)
			End Get
		End Property
		Shared ReadOnly Property LightGreen() As Color
			Get
				Return New Color(144, 238, 144, 255)
			End Get
		End Property
		Shared ReadOnly Property LightPink() As Color
			Get
				Return New Color(255, 182, 193, 255)
			End Get
		End Property
		Shared ReadOnly Property LightSalmon() As Color
			Get
				Return New Color(255, 160, 122, 255)
			End Get
		End Property
		Shared ReadOnly Property LightSeaGreen() As Color
			Get
				Return New Color(32, 178, 170, 255)
			End Get
		End Property
		Shared ReadOnly Property LightSkyBlue() As Color
			Get
				Return New Color(135, 206, 250, 255)
			End Get
		End Property
		Shared ReadOnly Property LightSlateGray() As Color
			Get
				Return New Color(119, 136, 153, 255)
			End Get
		End Property
		Shared ReadOnly Property LightSteelBlue() As Color
			Get
				Return New Color(176, 196, 222, 255)
			End Get
		End Property
		Shared ReadOnly Property LightYellow() As Color
			Get
				Return New Color(255, 255, 224, 255)
			End Get
		End Property
		Shared ReadOnly Property Lime() As Color
			Get
				Return New Color(0, 255, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property LimeGreen() As Color
			Get
				Return New Color(50, 205, 50, 255)
			End Get
		End Property
		Shared ReadOnly Property Linen() As Color
			Get
				Return New Color(250, 240, 230, 255)
			End Get
		End Property
		Shared ReadOnly Property Magenta() As Color
			Get
				Return New Color(255, 0, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property Maroon() As Color
			Get
				Return New Color(128, 0, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property MediumAquamarine() As Color
			Get
				Return New Color(102, 205, 170, 255)
			End Get
		End Property
		Shared ReadOnly Property MediumBlue() As Color
			Get
				Return New Color(0, 0, 205, 255)
			End Get
		End Property
		Shared ReadOnly Property MediumOrchid() As Color
			Get
				Return New Color(186, 85, 211, 255)
			End Get
		End Property
		Shared ReadOnly Property MediumPurple() As Color
			Get
				Return New Color(147, 112, 219, 255)
			End Get
		End Property
		Shared ReadOnly Property MediumSeaGreen() As Color
			Get
				Return New Color(60, 179, 113, 255)
			End Get
		End Property
		Shared ReadOnly Property MediumSlateBlue() As Color
			Get
				Return New Color(123, 104, 238, 255)
			End Get
		End Property
		Shared ReadOnly Property MediumSpringGreen() As Color
			Get
				Return New Color(0, 250, 154, 255)
			End Get
		End Property
		Shared ReadOnly Property MediumTurquoise() As Color
			Get
				Return New Color(72, 209, 204, 255)
			End Get
		End Property
		Shared ReadOnly Property MediumVioletRed() As Color
			Get
				Return New Color(199, 21, 133, 255)
			End Get
		End Property
		Shared ReadOnly Property MidnightBlue() As Color
			Get
				Return New Color(25, 25, 112, 255)
			End Get
		End Property
		Shared ReadOnly Property MintCream() As Color
			Get
				Return New Color(245, 255, 250, 255)
			End Get
		End Property
		Shared ReadOnly Property MistyRose() As Color
			Get
				Return New Color(255, 228, 225, 255)
			End Get
		End Property
		Shared ReadOnly Property Moccasin() As Color
			Get
				Return New Color(255, 228, 181, 255)
			End Get
		End Property
		Shared ReadOnly Property NavajoWhite() As Color
			Get
				Return New Color(255, 222, 173, 255)
			End Get
		End Property
		Shared ReadOnly Property Navy() As Color
			Get
				Return New Color(0, 0, 128, 255)
			End Get
		End Property
		Shared ReadOnly Property OldLace() As Color
			Get
				Return New Color(253, 245, 230, 255)
			End Get
		End Property
		Shared ReadOnly Property Olive() As Color
			Get
				Return New Color(128, 128, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property OliveDrab() As Color
			Get
				Return New Color(107, 142, 35, 255)
			End Get
		End Property
		Shared ReadOnly Property Orange() As Color
			Get
				Return New Color(255, 165, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property OrangeRed() As Color
			Get
				Return New Color(255, 69, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property Orchid() As Color
			Get
				Return New Color(218, 112, 214, 255)
			End Get
		End Property
		Shared ReadOnly Property PaleGoldenrod() As Color
			Get
				Return New Color(238, 232, 170, 255)
			End Get
		End Property
		Shared ReadOnly Property PaleGreen() As Color
			Get
				Return New Color(152, 251, 152, 255)
			End Get
		End Property
		Shared ReadOnly Property PaleTurquoise() As Color
			Get
				Return New Color(175, 238, 238, 255)
			End Get
		End Property
		Shared ReadOnly Property PaleVioletRed() As Color
			Get
				Return New Color(219, 112, 147, 255)
			End Get
		End Property
		Shared ReadOnly Property PapayaWhip() As Color
			Get
				Return New Color(255, 239, 213, 255)
			End Get
		End Property
		Shared ReadOnly Property PeachPuff() As Color
			Get
				Return New Color(255, 218, 185, 255)
			End Get
		End Property
		Shared ReadOnly Property Peru() As Color
			Get
				Return New Color(205, 133, 63, 255)
			End Get
		End Property
		Shared ReadOnly Property Pink() As Color
			Get
				Return New Color(255, 192, 203, 255)
			End Get
		End Property
		Shared ReadOnly Property Plum() As Color
			Get
				Return New Color(221, 160, 221, 255)
			End Get
		End Property
		Shared ReadOnly Property Red() As Color
			Get
				Return New Color(255, 0, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property RosyBrown() As Color
			Get
				Return New Color(188, 143, 143, 255)
			End Get
		End Property
		Shared ReadOnly Property RoyalBlue() As Color
			Get
				Return New Color(65, 105, 225, 255)
			End Get
		End Property
		Shared ReadOnly Property SaddleBrown() As Color
			Get
				Return New Color(139, 69, 19, 255)
			End Get
		End Property
		Shared ReadOnly Property Salmon() As Color
			Get
				Return New Color(250, 128, 114, 255)
			End Get
		End Property
		Shared ReadOnly Property SandyBrown() As Color
			Get
				Return New Color(244, 164, 96, 255)
			End Get
		End Property
		Shared ReadOnly Property SeaGreen() As Color
			Get
				Return New Color(46, 139, 87, 255)
			End Get
		End Property
		Shared ReadOnly Property SeaShell() As Color
			Get
				Return New Color(255, 245, 238, 255)
			End Get
		End Property
		Shared ReadOnly Property Sienna() As Color
			Get
				Return New Color(160, 82, 45, 255)
			End Get
		End Property
		Shared ReadOnly Property Silver() As Color
			Get
				Return New Color(192, 192, 192, 255)
			End Get
		End Property
		Shared ReadOnly Property SkyBlue() As Color
			Get
				Return New Color(135, 206, 235, 255)
			End Get
		End Property
		Shared ReadOnly Property SlateBlue() As Color
			Get
				Return New Color(106, 90, 205, 255)
			End Get
		End Property
		Shared ReadOnly Property SlateGray() As Color
			Get
				Return New Color(112, 128, 144, 255)
			End Get
		End Property
		Shared ReadOnly Property Snow() As Color
			Get
				Return New Color(255, 250, 250, 255)
			End Get
		End Property
		Shared ReadOnly Property SpringGreen() As Color
			Get
				Return New Color(0, 255, 127, 255)
			End Get
		End Property
		Shared ReadOnly Property SteelBlue() As Color
			Get
				Return New Color(70, 130, 180, 255)
			End Get
		End Property
		Shared ReadOnly Property Tan() As Color
			Get
				Return New Color(210, 180, 140, 255)
			End Get
		End Property
		Shared ReadOnly Property Teal() As Color
			Get
				Return New Color(0, 128, 128, 255)
			End Get
		End Property
		Shared ReadOnly Property Thistle() As Color
			Get
				Return New Color(216, 191, 216, 255)
			End Get
		End Property
		Shared ReadOnly Property Tomato() As Color
			Get
				Return New Color(255, 99, 71, 255)
			End Get
		End Property
		Shared ReadOnly Property TransparentBlack() As Color
			Get
				Return New Color(0, 0, 0, 0)
			End Get
		End Property
		Shared ReadOnly Property TransparentWhite() As Color
			Get
				Return New Color(255, 255, 255, 0)
			End Get
		End Property
		Shared ReadOnly Property Turquoise() As Color
			Get
				Return New Color(64, 224, 208, 255)
			End Get
		End Property
		Shared ReadOnly Property Violet() As Color
			Get
				Return New Color(238, 130, 238, 255)
			End Get
		End Property
		Shared ReadOnly Property Wheat() As Color
			Get
				Return New Color(245, 222, 179, 255)
			End Get
		End Property
		Shared ReadOnly Property White() As Color
			Get
				Return New Color(255, 255, 255, 255)
			End Get
		End Property
		Shared ReadOnly Property WhiteSmoke() As Color
			Get
				Return New Color(245, 245, 245, 255)
			End Get
		End Property
		Shared ReadOnly Property Yellow() As Color
			Get
				Return New Color(255, 255, 0, 255)
			End Get
		End Property
		Shared ReadOnly Property YellowGreen() As Color
			Get
				Return New Color(154, 205, 50, 255)
			End Get
		End Property
#End Region
#Region "Methods"
		Private Sub PackFromVector4(ByVal v1 As Vector4) Implements IPackedVector.PackFromVector4

		End Sub
		Public Property PackedValue() As UInteger Implements sl3core.sl3graphics.sl3PackedVector.IPackedVector(Of UInteger).PackedValue
			Get

			End Get
			Set(ByVal value As UInteger)

			End Set
		End Property
#End Region
#Region "Functions"
		''' <summary>
		''' Linearly interpolates between two colors
		''' </summary>
		''' <param name="c1">Color value</param>
		''' <param name="c2">Color value</param>
		''' <param name="weight">Singe value between 0 and 1.0 indicating the weight of c2</param>
		''' <returns>Color value, that has been interpolated between the two passed colors</returns>
		''' <remarks></remarks>
		Shared Function Lerp(ByRef c1 As Color, ByRef c2 As Color, ByVal w As Single) As Color
			Return New Color((c1.R + w * (c2.R - c1.R)), (c1.G + w * (c2.G - c1.G)), (c1.B + w * (c2.B - c1.B)), (c1.A + w * (c2.A - c1.A)))
		End Function
		''' <summary>
		''' needs coding
		''' </summary>
		''' <param name="other"></param>
		''' <returns></returns>
		''' <remarks></remarks>
		Public Overrides Function Equals(ByVal other As Color) As Boolean Implements System.IEquatable(Of Color).Equals

		End Function
#End Region

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure Matrix
		Implements IEquatable(Of Matrix)
#Region "Variables"
		Public M11 As Single
		Public M12 As Single
		Public M13 As Single
		Public M14 As Single
		Public M21 As Single
		Public M22 As Single
		Public M23 As Single
		Public M24 As Single
		Public M31 As Single
		Public M32 As Single
		Public M33 As Single
		Public M34 As Single
		Public M41 As Single
		Public M42 As Single
		Public M43 As Single
		Public M44 As Single
#End Region
#Region "Properties"
		Public Shared ReadOnly Property Identity() As Matrix
			Get
				Return New Matrix(1)
			End Get
		End Property
		Public Property UP() As Vector3
			Get
				Return New Vector3(Me.M21, Me.M22, Me.M23)
			End Get
			Set(ByVal value As Vector3)
				Me.M21 = value.X
				Me.M22 = value.Y
				Me.M23 = value.Z
			End Set
		End Property
		Public Property Down() As Vector3
			Get
				Return New Vector3(-Me.M21, -Me.M22, -Me.M23)
			End Get
			Set(ByVal value As Vector3)
				Me.M21 = -value.X
				Me.M22 = -value.Y
				Me.M23 = -value.Z
			End Set
		End Property
		Public Property Right() As Vector3
			Get
				Return New Vector3(Me.M11, Me.M12, Me.M13)
			End Get
			Set(ByVal value As Vector3)
				Me.M11 = value.X
				Me.M12 = value.Y
				Me.M13 = value.Z
			End Set
		End Property
		Public Property Left() As Vector3
			Get
				Return New Vector3(-Me.M11, -Me.M12, -Me.M13)
			End Get
			Set(ByVal value As Vector3)
				Me.M11 = -value.X
				Me.M12 = -value.Y
				Me.M13 = -value.Z
			End Set
		End Property
		Public Property Forward() As Vector3
			Get
				Return New Vector3(-Me.M31, -Me.M32, -Me.M33)
			End Get
			Set(ByVal value As Vector3)
				Me.M31 = -value.X
				Me.M32 = -value.Y
				Me.M33 = -value.Z
			End Set
		End Property
		Public Property Backward() As Vector3
			Get
				Return New Vector3(Me.M31, Me.M32, Me.M33)
			End Get
			Set(ByVal value As Vector3)
				Me.M31 = value.X
				Me.M32 = value.Y
				Me.M33 = value.Z
			End Set
		End Property
		Public Property Translation() As Vector3
			Get
				Return New Vector3(Me.M41, Me.M42, Me.M43)
			End Get
			Set(ByVal value As Vector3)
				Me.M41 = value.X
				Me.M42 = value.Y
				Me.M43 = value.Z
			End Set
		End Property
#End Region
#Region "Constructors"
		Private Sub New(ByVal identity As Single)
			Me.M12 = Me.M13 = Me.M14 = 0.0!
			Me.M21 = Me.M23 = Me.M24 = 0.0!
			Me.M31 = Me.M32 = Me.M34 = 0.0!
			Me.M41 = Me.M42 = Me.M43 = 0.0!
			Me.M11 = Me.M22 = Me.M33 = Me.M44 = identity
		End Sub
		Public Sub New(ByVal Xplane As Vector4, ByVal Yplane As Vector4, ByVal Zplane As Vector4, ByVal Wplane As Vector4)
			Me.M11 = Xplane.X
			Me.M12 = Xplane.Y
			Me.M13 = Xplane.Z
			Me.M14 = Xplane.W
			Me.M21 = Yplane.X
			Me.M22 = Yplane.Y
			Me.M23 = Yplane.Z
			Me.M24 = Yplane.W
			Me.M31 = Zplane.X
			Me.M32 = Zplane.Y
			Me.M33 = Zplane.Z
			Me.M34 = Zplane.W
			Me.M41 = Wplane.X
			Me.M42 = Wplane.Y
			Me.M43 = Wplane.Z
			Me.M44 = Wplane.W
		End Sub
		Public Sub New(ByVal m11 As Single, ByVal m12 As Single, ByVal m13 As Single, ByVal m14 As Single, _
		 ByVal m21 As Single, ByVal m22 As Single, ByVal m23 As Single, ByVal m24 As Single, _
		 ByVal m31 As Single, ByVal m32 As Single, ByVal m33 As Single, ByVal m34 As Single, _
		 ByVal m41 As Single, ByVal m42 As Single, ByVal m43 As Single, ByVal m44 As Single)
			Me.M11 = m11
			Me.M12 = m12
			Me.M13 = m13
			Me.M14 = m14
			Me.M21 = m21
			Me.M22 = m22
			Me.M23 = m23
			Me.M24 = m24
			Me.M31 = m31
			Me.M32 = m32
			Me.M33 = m33
			Me.M34 = m34
			Me.M41 = m41
			Me.M42 = m42
			Me.M43 = m43
			Me.M44 = m44
		End Sub
#End Region
#Region "Methods"
		Public Shared Sub Add(ByVal m1 As Matrix, ByVal m2 As Matrix, <Out()> ByRef m3 As Matrix)
			m3.M11 = (m1.M11 + m2.M11)
			m3.M12 = (m1.M12 + m2.M12)
			m3.M13 = (m1.M13 + m2.M13)
			m3.M14 = (m1.M14 + m2.M14)
			m3.M21 = (m1.M21 + m2.M21)
			m3.M22 = (m1.M22 + m2.M22)
			m3.M23 = (m1.M23 + m2.M23)
			m3.M24 = (m1.M24 + m2.M24)
			m3.M31 = (m1.M31 + m2.M31)
			m3.M32 = (m1.M32 + m2.M32)
			m3.M33 = (m1.M33 + m2.M33)
			m3.M34 = (m1.M34 + m2.M34)
			m3.M41 = (m1.M41 + m2.M41)
			m3.M42 = (m1.M42 + m2.M42)
			m3.M43 = (m1.M43 + m2.M43)
			m3.M44 = (m1.M44 + m2.M44)
		End Sub
		Public Shared Sub CreateBillboard(ByVal objPos As Vector3, ByVal camPos As Vector3, ByVal camUp As Vector3, ByVal camFor As Vector3?, <Out()> ByRef m1 As Matrix)
			Dim v1, v2, v3 As Vector3
			v1.X = objPos.X - camPos.X
			v1.Y = objPos.Y - camPos.Y
			v1.Z = objPos.Z - camPos.Z
			Dim num As Single = v1.LengthSquared
			If (num < 0.0001!) Then
				v1 = IIf(camFor.HasValue, Vector3.op_UnaryNegation(camFor.Value), Vector3.Forward)
			Else
				Vector3.Multiply(v1, (CSng((1.0! / CSng(Sqrt(CDbl(num)))))), v1)
			End If
			Vector3.Cross(camUp, v1, v3)
			v3.Normalize()
			Vector3.Cross(v1, v3, v2)
			m1.M11 = v3.X
			m1.M12 = v3.Y
			m1.M13 = v3.Z
			m1.M14 = 0.0!
			m1.M21 = v2.X
			m1.M22 = v2.Y
			m1.M23 = v2.Z
			m1.M24 = 0.0!
			m1.M31 = v1.X
			m1.M32 = v1.Y
			m1.M33 = v1.Z
			m1.M34 = 0.0!
			m1.M41 = objPos.X
			m1.M42 = objPos.Y
			m1.M43 = objPos.Z
			m1.M44 = 1.0!
		End Sub
		Public Shared Sub CreateConstrainedBillboard(ByVal objPos As Vector3, ByVal camPos As Vector3, ByVal rotAxis As Vector3, ByVal camFor As Vector3?, ByVal objFor As Vector3?, <Out()> ByRef m1 As Matrix)
			Dim num As Single
			Dim v1 As Vector3
			Dim v2 As Vector3
			Dim v3 As Vector3
			v2.X = objPos.X - camPos.X
			v2.Y = objPos.Y - camPos.Y
			v2.Z = objPos.Z - camPos.Z
			Dim num2 As Single = v2.LengthSquared
			If (num2 < 0.0001!) Then
				v2 = IIf(camFor.HasValue, Vector3.op_UnaryNegation(camFor.Value), v3.Forward)
			Else
				Vector3.Multiply(v2, CSng((1.0! / CSng(Sqrt(CDbl(num2))))), v2)
			End If
			Dim v4 As Vector3 = rotAxis
			Vector3.Dot(rotAxis, v2, num)
			If (Abs(num) > 0.9982547!) Then
				If objFor.HasValue Then
					v1 = objFor.Value
					Vector3.Dot(rotAxis, v1, num)
					If (Abs(num) > 0.9982547!) Then
						num = (((rotAxis.X * Vector3.Forward.X) + (rotAxis.Y * Vector3.Forward.Y)) + (rotAxis.Z * Vector3.Forward.Z))
						v1 = IIf(Abs(num) > 0.9982547!, Vector3.Right, Vector3.Forward)
					End If
				Else
					num = (((rotAxis.X * Vector3.Forward.X) + (rotAxis.Y * Vector3.Forward.Y)) + (rotAxis.Z * Vector3.Forward.Z))
					v1 = IIf(Abs(num) > 0.9982547!, Vector3.Right, Vector3.Forward)
				End If
				Vector3.Cross(rotAxis, v1, v3)
				v3.Normalize()
				Vector3.Cross(v3, rotAxis, v1)
				v1.Normalize()
			Else
				Vector3.Cross(rotAxis, v2, v3)
				v3.Normalize()
				Vector3.Cross(v3, v4, v1)
				v1.Normalize()
			End If
			m1.M11 = v3.X
			m1.M12 = v3.Y
			m1.M13 = v3.Z
			m1.M14 = 0.0!
			m1.M21 = v4.X
			m1.M22 = v4.Y
			m1.M23 = v4.Z
			m1.M24 = 0.0!
			m1.M31 = v1.X
			m1.M32 = v1.Y
			m1.M33 = v1.Z
			m1.M34 = 0.0!
			m1.M41 = objPos.X
			m1.M42 = objPos.Y
			m1.M43 = objPos.Z
			m1.M44 = 1.0!
		End Sub
		Public Shared Sub CreateFromAxisAngle(ByVal axis As Vector3, ByVal angle As Single, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			Dim X As Single = axis.X
			Dim Y As Single = axis.Y
			Dim Z As Single = axis.Z
			Dim num2 As Single = CSng(Sin(CDbl(angle)))
			Dim num As Single = CSng(Cos(CDbl(angle)))
			Dim num11 As Single = (X * X)
			Dim num10 As Single = (Y * Y)
			Dim num9 As Single = (Z * Z)
			Dim num8 As Single = (X * Y)
			Dim num7 As Single = (X * Z)
			Dim num6 As Single = (Y * Z)
			m1.M11 = (num11 + (num * (1.0! - num11)))
			m1.M12 = ((num8 - (num * num8)) + (num2 * Z))
			m1.M13 = ((num7 - (num * num7)) - (num2 * Y))
			m1.M21 = ((num8 - (num * num8)) - (num2 * Z))
			m1.M22 = (num10 + (num * (1.0! - num10)))
			m1.M23 = ((num6 - (num * num6)) + (num2 * X))
			m1.M31 = ((num7 - (num * num7)) + (num2 * Y))
			m1.M32 = ((num6 - (num * num6)) - (num2 * X))
			m1.M33 = (num9 + (num * (1.0! - num9)))
		End Sub
		Public Shared Sub CreateFromQuaternion(ByVal q1 As Quaternion, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			Dim num9 As Single = (q1.X * q1.X)
			Dim num8 As Single = (q1.Y * q1.Y)
			Dim num7 As Single = (q1.Z * q1.Z)
			Dim num6 As Single = (q1.X * q1.Y)
			Dim num5 As Single = (q1.Z * q1.W)
			Dim num4 As Single = (q1.Z * q1.X)
			Dim num3 As Single = (q1.Y * q1.W)
			Dim num2 As Single = (q1.Y * q1.Z)
			Dim num As Single = (q1.X * q1.W)
			m1.M11 = (1.0! - (2.0! * (num8 + num7)))
			m1.M12 = (2.0! * (num6 + num5))
			m1.M13 = (2.0! * (num4 - num3))
			m1.M21 = (2.0! * (num6 - num5))
			m1.M22 = (1.0! - (2.0! * (num7 + num9)))
			m1.M23 = (2.0! * (num2 + num))
			m1.M31 = (2.0! * (num4 + num3))
			m1.M32 = (2.0! * (num2 - num))
			m1.M33 = (1.0! - (2.0! * (num8 + num9)))
		End Sub
		Public Shared Sub CreateFromYawPitchRoll(ByVal yaw As Single, ByVal pitch As Single, ByVal roll As Single, <Out()> ByRef m1 As Matrix)
			Dim q1 As Quaternion
			Quaternion.CreateFromYawPitchRoll(yaw, pitch, roll, q1)
			Matrix.CreateFromQuaternion(q1, m1)
		End Sub
		Public Shared Sub CreateLookAt(ByVal pos As Vector3, ByVal tar As Vector3, ByVal up As Vector3, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			Dim v1 As Vector3 = Vector3.Normalize(Vector3.Subtract(pos, tar))
			Dim v2 As Vector3 = Vector3.Normalize(Vector3.Cross(up, v1))
			Dim v3 As Vector3 = Vector3.Cross(v1, v2)
			m1.M11 = v2.X
			m1.M12 = v3.X
			m1.M13 = v1.X
			m1.M21 = v2.Y
			m1.M22 = v3.Y
			m1.M23 = v1.Y
			m1.M31 = v2.Z
			m1.M32 = v3.Z
			m1.M31 = v1.Z
			m1.M41 = -Vector3.Dot(v2, pos)
			m1.M42 = -Vector3.Dot(v3, pos)
			m1.M43 = -Vector3.Dot(v1, pos)
		End Sub
		Public Shared Sub CreateOrthographic(ByVal width As Single, ByVal height As Single, ByVal zNear As Single, ByVal zFar As Single, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			m1.M11 = (2.0! / width)
			m1.M22 = (2.0! / height)
			m1.M33 = (1.0! / (zNear - zFar))
			m1.M43 = (zNear / (zNear - zFar))
		End Sub
		Public Shared Sub CreateOrhtographicOffCenter(ByVal left As Single, ByVal right As Single, ByVal bottom As Single, ByVal top As Single, ByVal zNear As Single, ByVal zFar As Single, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			m1.M11 = (2.0! / (right - left))
			m1.M22 = (2.0! / (top - bottom))
			m1.M33 = (2.0! / (zNear - zFar))
			m1.M41 = ((left + right) / (left - right))
			m1.M42 = ((top + bottom) / (bottom - top))
			m1.M43 = (zNear / (zNear - zFar))
		End Sub
		Public Shared Sub CreatePerspective(ByVal width As Single, ByVal height As Single, ByVal near As Single, ByVal far As Single, <Out()> ByRef m1 As Matrix)
			If (near <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance has a negative value")
			End If
			If (far <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("farPlaneDistance has a negative value")
			End If
			If (near >= far) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance has the same distance as farPlaneDistance")
			End If
			m1 = New Matrix(0)
			m1.M11 = ((2.0! * near) / width)
			m1.M22 = ((2.0! * near) / height)
			m1.M33 = (far / (near - far))
			m1.M34 = -1.0!
			m1.M43 = ((near * far) / (near - far))
		End Sub
		Public Shared Sub CreatePerspectiveFieldOfView(ByVal fov As Single, ByVal aspect As Single, ByVal near As Single, ByVal far As Single, <Out()> ByRef m1 As Matrix)
			If ((fov <= 0.0!) OrElse (fov >= 3.141593!)) Then
				Throw New ArgumentOutOfRangeException("Field of View is not within bounds")
			End If
			If (near <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance is not within range")
			End If
			If (far <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("farPlaneDistance is not within range")
			End If
			If (near >= far) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance is greater than the farPlaneDistance")
			End If
			m1 = New Matrix(0)
			Dim num As Single = (1.0! / CSng(Tan(CDbl((fov * 0.5!)))))
			Dim num9 As Single = (num / aspect)
			m1.M11 = num9
			m1.M22 = num
			m1.M33 = (far / (near - far))
			m1.M34 = -1.0!
			m1.M43 = ((near * far) / (near - far))
		End Sub
		Public Shared Sub CreatePerspectiveOffCenter(ByVal left As Single, ByVal right As Single, ByVal bottom As Single, ByVal top As Single, ByVal near As Single, ByVal far As Single, <Out()> ByRef m1 As Matrix)
			If (near <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance is out of range")
			End If
			If (far <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("farPlaneDistance is out of range")
			End If
			If (near >= far) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance exceeds the farPlaneDistance")
			End If
			m1 = New Matrix(0)
			m1.M11 = ((2.0! * near) / (right - left))
			m1.M22 = ((2.0! * near) / (top - bottom))
			m1.M31 = ((left + right) / (right - left))
			m1.M32 = ((top + bottom) / (top - bottom))
			m1.M33 = (far / (near - far))
			m1.M34 = -1.0!
			m1.M43 = ((near * far) / (near - far))
		End Sub
		Public Shared Sub CreateReflections(ByVal value As Plane, <Out()> ByRef m1 As Matrix)
			m1 = New Matrix(1)
			value.Normalize()
			Dim X As Single = value.Normalize.X
			Dim Y As Single = value.Normalize.Y
			Dim Z As Single = value.Normalize.Z
			Dim num3 As Single = (-2.0! * X)
			Dim num2 As Single = (-2.0! * Y)
			Dim num As Single = (-2.0! * Z)
			m1.M11 = ((num3 * X) + 1.0!)
			m1.M12 = (num2 * X)
			m1.M13 = (num * X)
			m1.M21 = (num3 * Y)
			m1.M22 = ((num2 * Y) + 1.0!)
			m1.M23 = (num * Y)
			m1.M31 = (num3 * Z)
			m1.M32 = (num2 * Z)
			m1.M33 = ((num * Z) + 1.0!)
			m1.M41 = (num3 * value.D)
			m1.M42 = (num2 * value.D)
			m1.M43 = (num * value.D)
		End Sub
		Public Shared Sub CreateRotationX(ByVal rads As Single, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			Dim num2 As Single = CSng(Cos(CDbl(rads)))
			Dim num As Single = CSng(Sin(CDbl(rads)))
			m1.M22 = num2
			m1.M23 = num
			m1.M32 = -num
			m1.M33 = num2
		End Sub
		Public Shared Sub CreateRotationY(ByVal rads As Single, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			Dim num2 As Single = CSng(Cos(CDbl(rads)))
			Dim num As Single = CSng(Sin(CDbl(rads)))
			m1.M11 = num2
			m1.M13 = -num
			m1.M31 = num
			m1.M33 = num2
		End Sub
		Public Shared Sub CreateRotationZ(ByVal rads As Single, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			Dim num2 As Single = CSng(Cos(CDbl(rads)))
			Dim num As Single = CSng(Sin(CDbl(rads)))
			m1.M11 = num2
			m1.M12 = num
			m1.M21 = -num
			m1.M22 = num2
		End Sub
		Public Shared Sub CreateScale(ByVal scale As Single, <Out()> ByVal m1 As Matrix)
			m1 = Matrix.Identity
			m1.M11 = scale
			m1.M22 = scale
			m1.M33 = scale
		End Sub
		Public Shared Sub CreateScale(ByVal scales As Vector3, <Out()> ByVal m1 As Matrix)
			m1 = Matrix.Identity
			Dim x As Single = scales.X
			Dim y As Single = scales.Y
			Dim z As Single = scales.Z
			m1.M11 = x
			m1.M22 = y
			m1.M33 = z
		End Sub
		Public Shared Sub CreateScale(ByVal xScale As Single, ByVal yScale As Single, ByVal zScale As Single, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			Dim num3 As Single = xScale
			Dim num2 As Single = yScale
			Dim num As Single = zScale
			m1.M11 = num3
			m1.M22 = num2
			m1.M33 = num
		End Sub
		Public Shared Sub CreateShadow(ByVal light As Vector3, ByVal p1 As Plane, <Out()> ByRef m1 As Matrix)
			Dim p2 As Plane
			Plane.Normalize(p1, p2)
			Dim num As Single = (((p2.Normal.X * light.X) + (p2.Normal.Y * light.Y)) + (p2.Normal.Z * light.Z))
			Dim num5 As Single = -p2.Normal.X
			Dim num4 As Single = -p2.Normal.Y
			Dim num3 As Single = -p2.Normal.Z
			Dim num2 As Single = -p2.D
			m1 = New Matrix(0)
			m1.M11 = ((num5 * light.X) + num)
			m1.M21 = (num4 * light.X)
			m1.M31 = (num3 * light.X)
			m1.M41 = (num2 * light.X)
			m1.M12 = (num5 * light.Y)
			m1.M22 = ((num4 * light.Y) + num)
			m1.M32 = (num3 * light.Y)
			m1.M42 = (num2 * light.Y)
			m1.M13 = (num5 * light.Z)
			m1.M23 = (num4 * light.Z)
			m1.M33 = ((num3 * light.Z) + num)
			m1.M43 = (num2 * light.Z)
			m1.M44 = num
		End Sub
		Public Shared Sub CreateTranslation(ByVal pos As Vector3, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			m1.M41 = pos.X
			m1.M42 = pos.Y
			m1.M43 = pos.Z
		End Sub
		Public Shared Sub CreateTranslation(ByVal xpos As Single, ByVal ypos As Single, ByVal zpos As Single, <Out()> ByRef m1 As Matrix)
			m1 = Matrix.Identity
			m1.M41 = xpos
			m1.M42 = ypos
			m1.M43 = zpos
		End Sub
		Public Shared Sub CreateWorld(ByVal pos As Vector3, ByVal forw As Vector3, ByVal up As Vector3, <Out()> ByRef m1 As Matrix)
			m1 = New Matrix(1)
			Dim v1 As Vector3 = Vector3.Normalize(Vector3.op_UnaryNegation(forw))
			Dim v2 As Vector3 = Vector3.Normalize(Vector3.Cross(up, v1))
			Dim v3 As Vector3 = Vector3.Cross(v1, v2)
			m1.M11 = v2.X
			m1.M12 = v2.Y
			m1.M13 = v2.Z
			m1.M21 = v3.X
			m1.M22 = v3.Y
			m1.M23 = v3.Z
			m1.M31 = v1.X
			m1.M32 = v1.Y
			m1.M33 = v1.Z
			m1.M41 = pos.X
			m1.M42 = pos.Y
			m1.M43 = pos.Z
		End Sub
		Public Shared Sub Divide(ByVal m1 As Matrix, ByVal factor As Single, <Out()> ByRef m2 As Matrix)
			m2.M11 = (m1.M11 / factor)
			m2.M12 = (m1.M12 / factor)
			m2.M13 = (m1.M13 / factor)
			m2.M14 = (m1.M14 / factor)
			m2.M21 = (m1.M21 / factor)
			m2.M22 = (m1.M22 / factor)
			m2.M23 = (m1.M23 / factor)
			m2.M24 = (m1.M24 / factor)
			m2.M31 = (m1.M31 / factor)
			m2.M32 = (m1.M32 / factor)
			m2.M33 = (m1.M33 / factor)
			m2.M34 = (m1.M34 / factor)
			m2.M41 = (m1.M41 / factor)
			m2.M42 = (m1.M42 / factor)
			m2.M43 = (m1.M43 / factor)
			m2.M44 = (m1.M44 / factor)
		End Sub
		Public Shared Sub Divide(ByVal m1 As Matrix, ByVal m2 As Matrix, <Out()> ByRef m3 As Matrix)
			m3.M11 = (m1.M11 / m2.M11)
			m3.M12 = (m1.M12 / m2.M12)
			m3.M13 = (m1.M13 / m2.M13)
			m3.M14 = (m1.M14 / m2.M14)
			m3.M21 = (m1.M21 / m2.M21)
			m3.M22 = (m1.M22 / m2.M22)
			m3.M23 = (m1.M23 / m2.M23)
			m3.M24 = (m1.M24 / m2.M24)
			m3.M31 = (m1.M31 / m2.M31)
			m3.M32 = (m1.M32 / m2.M32)
			m3.M33 = (m1.M33 / m2.M33)
			m3.M34 = (m1.M34 / m2.M34)
			m3.M41 = (m1.M41 / m2.M41)
			m3.M42 = (m1.M42 / m2.M42)
			m3.M43 = (m1.M43 / m2.M43)
			m3.M44 = (m1.M44 / m2.M44)
		End Sub
		Public Shared Sub Invert(ByVal m1 As Matrix, <Out()> ByRef m2 As Matrix)
			Dim num5 As Single = m1.M11
			Dim num4 As Single = m1.M12
			Dim num3 As Single = m1.M13
			Dim num2 As Single = m1.M14
			Dim num9 As Single = m1.M21
			Dim num8 As Single = m1.M22
			Dim num7 As Single = m1.M23
			Dim num6 As Single = m1.M24
			Dim num17 As Single = m1.M31
			Dim num16 As Single = m1.M32
			Dim num15 As Single = m1.M33
			Dim num14 As Single = m1.M34
			Dim num13 As Single = m1.M41
			Dim num12 As Single = m1.M42
			Dim num11 As Single = m1.M43
			Dim num10 As Single = m1.M44
			Dim num23 As Single = ((num15 * num10) - (num14 * num11))
			Dim num22 As Single = ((num16 * num10) - (num14 * num12))
			Dim num21 As Single = ((num16 * num11) - (num15 * num12))
			Dim num20 As Single = ((num17 * num10) - (num14 * num13))
			Dim num19 As Single = ((num17 * num11) - (num15 * num13))
			Dim num18 As Single = ((num17 * num12) - (num16 * num13))
			Dim num39 As Single = (((num8 * num23) - (num7 * num22)) + (num6 * num21))
			Dim num38 As Single = -(((num9 * num23) - (num7 * num20)) + (num6 * num19))
			Dim num37 As Single = (((num9 * num22) - (num8 * num20)) + (num6 * num18))
			Dim num36 As Single = -(((num9 * num21) - (num8 * num19)) + (num7 * num18))
			Dim num As Single = (1.0! / ((((num5 * num39) + (num4 * num38)) + (num3 * num37)) + (num2 * num36)))
			m2.M11 = (num39 * num)
			m2.M21 = (num38 * num)
			m2.M31 = (num37 * num)
			m2.M41 = (num36 * num)
			m2.M12 = (-(((num4 * num23) - (num3 * num22)) + (num2 * num21)) * num)
			m2.M22 = ((((num5 * num23) - (num3 * num20)) + (num2 * num19)) * num)
			m2.M32 = (-(((num5 * num22) - (num4 * num20)) + (num2 * num18)) * num)
			m2.M42 = ((((num5 * num21) - (num4 * num19)) + (num3 * num18)) * num)
			Dim num35 As Single = ((num7 * num10) - (num6 * num11))
			Dim num34 As Single = ((num8 * num10) - (num6 * num12))
			Dim num33 As Single = ((num8 * num11) - (num7 * num12))
			Dim num32 As Single = ((num9 * num10) - (num6 * num13))
			Dim num31 As Single = ((num9 * num11) - (num7 * num13))
			Dim num30 As Single = ((num9 * num12) - (num8 * num13))
			m2.M13 = ((((num4 * num35) - (num3 * num34)) + (num2 * num33)) * num)
			m2.M23 = (-(((num5 * num35) - (num3 * num32)) + (num2 * num31)) * num)
			m2.M33 = ((((num5 * num34) - (num4 * num32)) + (num2 * num30)) * num)
			m2.M43 = (-(((num5 * num33) - (num4 * num32)) + (num3 * num30)) * num)
			Dim num29 As Single = ((num7 * num14) - (num6 * num15))
			Dim num28 As Single = ((num8 * num14) - (num6 * num16))
			Dim num27 As Single = ((num8 * num15) - (num7 * num16))
			Dim num26 As Single = ((num9 * num14) - (num6 * num17))
			Dim num25 As Single = ((num9 * num15) - (num7 * num17))
			Dim num24 As Single = ((num9 * num16) - (num8 * num17))
			m2.M14 = (-(((num4 * num29) - (num3 * num28)) + (num2 * num27)) * num)
			m2.M24 = ((((num5 * num29) - (num3 * num26)) + (num2 * num25)) * num)
			m2.M34 = (-(((num5 * num28) - (num4 * num26)) + (num2 * num24)) * num)
			m2.M44 = ((((num5 * num27) - (num4 * num25)) + (num3 * num24)) * num)
		End Sub
		Public Shared Sub Lerp(ByVal m1 As Matrix, ByVal m2 As Matrix, ByVal factor As Single, <Out()> ByRef m3 As Matrix)
			m3.M11 = (m1.M11 + ((m2.M11 - m1.M11) * factor))
			m3.M12 = (m1.M12 + ((m2.M12 - m1.M12) * factor))
			m3.M13 = (m1.M13 + ((m2.M13 - m1.M13) * factor))
			m3.M14 = (m1.M14 + ((m2.M14 - m1.M14) * factor))
			m3.M21 = (m1.M21 + ((m2.M21 - m1.M21) * factor))
			m3.M22 = (m1.M22 + ((m2.M22 - m1.M22) * factor))
			m3.M23 = (m1.M23 + ((m2.M23 - m1.M23) * factor))
			m3.M24 = (m1.M24 + ((m2.M24 - m1.M24) * factor))
			m3.M31 = (m1.M31 + ((m2.M31 - m1.M31) * factor))
			m3.M32 = (m1.M32 + ((m2.M32 - m1.M32) * factor))
			m3.M33 = (m1.M33 + ((m2.M33 - m1.M33) * factor))
			m3.M34 = (m1.M34 + ((m2.M34 - m1.M34) * factor))
			m3.M41 = (m1.M41 + ((m2.M41 - m1.M41) * factor))
			m3.M42 = (m1.M42 + ((m2.M42 - m1.M42) * factor))
			m3.M43 = (m1.M43 + ((m2.M43 - m1.M43) * factor))
			m3.M44 = (m1.M44 + ((m2.M44 - m1.M44) * factor))
		End Sub
		Public Shared Sub Multiply(ByVal m1 As Matrix, ByVal m2 As Matrix, <Out()> ByRef m3 As Matrix)
			m3.M11 = ((((m1.M11 * m2.M11) + (m1.M12 * m2.M21)) + (m1.M13 * m2.M31)) + (m1.M14 * m2.M41))
			m3.M12 = ((((m1.M11 * m2.M12) + (m1.M12 * m2.M22)) + (m1.M13 * m2.M32)) + (m1.M14 * m2.M42))
			m3.M13 = ((((m1.M11 * m2.M13) + (m1.M12 * m2.M23)) + (m1.M13 * m2.M33)) + (m1.M14 * m2.M43))
			m3.M14 = ((((m1.M11 * m2.M14) + (m1.M12 * m2.M24)) + (m1.M13 * m2.M34)) + (m1.M14 * m2.M44))
			m3.M21 = ((((m1.M21 * m2.M11) + (m1.M22 * m2.M21)) + (m1.M23 * m2.M31)) + (m1.M24 * m2.M41))
			m3.M22 = ((((m1.M21 * m2.M12) + (m1.M22 * m2.M22)) + (m1.M23 * m2.M32)) + (m1.M24 * m2.M42))
			m3.M23 = ((((m1.M21 * m2.M13) + (m1.M22 * m2.M23)) + (m1.M23 * m2.M33)) + (m1.M24 * m2.M43))
			m3.M24 = ((((m1.M21 * m2.M14) + (m1.M22 * m2.M24)) + (m1.M23 * m2.M34)) + (m1.M24 * m2.M44))
			m3.M31 = ((((m1.M31 * m2.M11) + (m1.M32 * m2.M21)) + (m1.M33 * m2.M31)) + (m1.M34 * m2.M41))
			m3.M32 = ((((m1.M31 * m2.M12) + (m1.M32 * m2.M22)) + (m1.M33 * m2.M32)) + (m1.M34 * m2.M42))
			m3.M33 = ((((m1.M31 * m2.M13) + (m1.M32 * m2.M23)) + (m1.M33 * m2.M33)) + (m1.M34 * m2.M43))
			m3.M34 = ((((m1.M31 * m2.M14) + (m1.M32 * m2.M24)) + (m1.M33 * m2.M34)) + (m1.M34 * m2.M44))
			m3.M41 = ((((m1.M41 * m2.M11) + (m1.M42 * m2.M21)) + (m1.M43 * m2.M31)) + (m1.M44 * m2.M41))
			m3.M42 = ((((m1.M41 * m2.M12) + (m1.M42 * m2.M22)) + (m1.M43 * m2.M32)) + (m1.M44 * m2.M42))
			m3.M43 = ((((m1.M41 * m2.M13) + (m1.M42 * m2.M23)) + (m1.M43 * m2.M33)) + (m1.M44 * m2.M43))
			m3.M44 = ((((m1.M41 * m2.M14) + (m1.M42 * m2.M24)) + (m1.M43 * m2.M34)) + (m1.M44 * m2.M44))
		End Sub
		Public Shared Sub Multiply(ByVal m1 As Matrix, ByVal factor As Single, <Out()> ByRef m2 As Matrix)
			m2.M11 = (m1.M11 * factor)
			m2.M12 = (m1.M12 * factor)
			m2.M13 = (m1.M13 * factor)
			m2.M14 = (m1.M14 * factor)
			m2.M21 = (m1.M21 * factor)
			m2.M22 = (m1.M22 * factor)
			m2.M23 = (m1.M23 * factor)
			m2.M24 = (m1.M24 * factor)
			m2.M31 = (m1.M31 * factor)
			m2.M32 = (m1.M32 * factor)
			m2.M33 = (m1.M33 * factor)
			m2.M34 = (m1.M34 * factor)
			m2.M41 = (m1.M41 * factor)
			m2.M42 = (m1.M42 * factor)
			m2.M43 = (m1.M43 * factor)
			m2.M44 = (m1.M44 * factor)
		End Sub
		Public Shared Sub Negate(ByVal m1 As Matrix, <Out()> ByRef m2 As Matrix)
			m2.M11 = -m1.M11
			m2.M12 = -m1.M12
			m2.M13 = -m1.M13
			m2.M14 = -m1.M14
			m2.M21 = -m1.M21
			m2.M22 = -m1.M22
			m2.M23 = -m1.M23
			m2.M24 = -m1.M24
			m2.M31 = -m1.M31
			m2.M32 = -m1.M32
			m2.M33 = -m1.M33
			m2.M34 = -m1.M34
			m2.M41 = -m1.M41
			m2.M42 = -m1.M42
			m2.M43 = -m1.M43
			m2.M44 = -m1.M44
		End Sub
		Public Shared Sub Subtract(ByVal m1 As Matrix, ByVal m2 As Matrix, <Out()> ByRef m3 As Matrix)
			m3.M11 = (m1.M11 - m2.M11)
			m3.M12 = (m1.M12 - m2.M12)
			m3.M13 = (m1.M13 - m2.M13)
			m3.M14 = (m1.M14 - m2.M14)
			m3.M21 = (m1.M21 - m2.M21)
			m3.M22 = (m1.M22 - m2.M22)
			m3.M23 = (m1.M23 - m2.M23)
			m3.M24 = (m1.M24 - m2.M24)
			m3.M31 = (m1.M31 - m2.M31)
			m3.M32 = (m1.M32 - m2.M32)
			m3.M33 = (m1.M33 - m2.M33)
			m3.M34 = (m1.M34 - m2.M34)
			m3.M41 = (m1.M41 - m2.M41)
			m3.M42 = (m1.M42 - m2.M42)
			m3.M43 = (m1.M43 - m2.M43)
			m3.M44 = (m1.M44 - m2.M44)
		End Sub
#End Region
#Region "Functions"
		Public Shared Function Add(ByVal m1 As Matrix, ByVal m2 As Matrix) As Matrix
			Dim m3 As Matrix
			m3.M11 = (m1.M11 + m2.M11)
			m3.M12 = (m1.M12 + m2.M12)
			m3.M13 = (m1.M13 + m2.M13)
			m3.M14 = (m1.M14 + m2.M14)
			m3.M21 = (m1.M21 + m2.M21)
			m3.M22 = (m1.M22 + m2.M22)
			m3.M23 = (m1.M23 + m2.M23)
			m3.M24 = (m1.M24 + m2.M24)
			m3.M31 = (m1.M31 + m2.M31)
			m3.M32 = (m1.M32 + m2.M32)
			m3.M33 = (m1.M33 + m2.M33)
			m3.M34 = (m1.M34 + m2.M34)
			m3.M41 = (m1.M41 + m2.M41)
			m3.M42 = (m1.M42 + m2.M42)
			m3.M43 = (m1.M43 + m2.M43)
			m3.M44 = (m1.M44 + m2.M44)
			Return m3
		End Function
		Public Shared Function CreateBillboard(ByVal objPos As Vector3, ByVal camPos As Vector3, ByVal camUp As Vector3, ByVal camFor As Vector3?) As Matrix
			Dim m1 As Matrix
			Dim v1, v2, v3 As Vector3
			v1.X = objPos.X - camPos.X
			v1.Y = objPos.Y - camPos.Y
			v1.Z = objPos.Z - camPos.Z
			Dim num As Single = v1.LengthSquared
			If (num < 0.0001!) Then
				v1 = IIf(camFor.HasValue, Vector3.op_UnaryNegation(camFor.Value), Vector3.Forward)
			Else
				Vector3.Multiply(v1, (CSng((1.0! / CSng(Sqrt(CDbl(num)))))), v1)
			End If
			Vector3.Cross(camUp, v1, v3)
			v3.Normalize()
			Vector3.Cross(v1, v3, v2)
			m1.M11 = v3.X
			m1.M12 = v3.Y
			m1.M13 = v3.Z
			m1.M14 = 0.0!
			m1.M21 = v2.X
			m1.M22 = v2.Y
			m1.M23 = v2.Z
			m1.M24 = 0.0!
			m1.M31 = v1.X
			m1.M32 = v1.Y
			m1.M33 = v1.Z
			m1.M34 = 0.0!
			m1.M41 = objPos.X
			m1.M42 = objPos.Y
			m1.M43 = objPos.Z
			m1.M44 = 1.0!
			Return m1
		End Function
		Public Shared Function CreateConstrainedBillboard(ByVal objPos As Vector3, ByVal camPos As Vector3, ByVal rotAxis As Vector3, ByVal camFor As Vector3?, ByVal objFor As Vector3?) As Matrix
			Dim num As Single
			Dim v1 As Vector3
			Dim v2 As Vector3
			Dim v3 As Vector3
			Dim m1 As Matrix
			v2.X = objPos.X - camPos.X
			v2.Y = objPos.Y - camPos.Y
			v2.Z = objPos.Z - camPos.Z
			Dim num2 As Single = v2.LengthSquared
			If (num2 < 0.0001!) Then
				v2 = IIf(camFor.HasValue, Vector3.op_UnaryNegation(camFor.Value), v3.Forward)
			Else
				Vector3.Multiply(v2, CSng((1.0! / CSng(Sqrt(CDbl(num2))))), v2)
			End If
			Dim v4 As Vector3 = rotAxis
			Vector3.Dot(rotAxis, v2, num)
			If (Abs(num) > 0.9982547!) Then
				If objFor.HasValue Then
					v1 = objFor.Value
					Vector3.Dot(rotAxis, v1, num)
					If (Abs(num) > 0.9982547!) Then
						num = (((rotAxis.X * Vector3.Forward.X) + (rotAxis.Y * Vector3.Forward.Y)) + (rotAxis.Z * Vector3.Forward.Z))
						v1 = IIf(Abs(num) > 0.9982547!, Vector3.Right, Vector3.Forward)
					End If
				Else
					num = (((rotAxis.X * Vector3.Forward.X) + (rotAxis.Y * Vector3.Forward.Y)) + (rotAxis.Z * Vector3.Forward.Z))
					v1 = IIf(Abs(num) > 0.9982547!, Vector3.Right, Vector3.Forward)
				End If
				Vector3.Cross(rotAxis, v1, v3)
				v3.Normalize()
				Vector3.Cross(v3, rotAxis, v1)
				v1.Normalize()
			Else
				Vector3.Cross(rotAxis, v2, v3)
				v3.Normalize()
				Vector3.Cross(v3, v4, v1)
				v1.Normalize()
			End If
			m1.M11 = v3.X
			m1.M12 = v3.Y
			m1.M13 = v3.Z
			m1.M14 = 0.0!
			m1.M21 = v4.X
			m1.M22 = v4.Y
			m1.M23 = v4.Z
			m1.M24 = 0.0!
			m1.M31 = v1.X
			m1.M32 = v1.Y
			m1.M33 = v1.Z
			m1.M34 = 0.0!
			m1.M41 = objPos.X
			m1.M42 = objPos.Y
			m1.M43 = objPos.Z
			m1.M44 = 1.0!
			Return m1
		End Function
		Public Shared Function CreateFromAxisAngle(ByVal axis As Vector3, ByVal angle As Single) As Matrix
			Dim m1 As New Matrix(1)
			Dim X As Single = axis.X
			Dim Y As Single = axis.Y
			Dim Z As Single = axis.Z
			Dim num2 As Single = CSng(Sin(CDbl(angle)))
			Dim num As Single = CSng(Cos(CDbl(angle)))
			Dim num11 As Single = (X * X)
			Dim num10 As Single = (Y * Y)
			Dim num9 As Single = (Z * Z)
			Dim num8 As Single = (X * Y)
			Dim num7 As Single = (X * Z)
			Dim num6 As Single = (Y * Z)
			m1.M11 = (num11 + (num * (1.0! - num11)))
			m1.M12 = ((num8 - (num * num8)) + (num2 * Z))
			m1.M13 = ((num7 - (num * num7)) - (num2 * Y))
			m1.M21 = ((num8 - (num * num8)) - (num2 * Z))
			m1.M22 = (num10 + (num * (1.0! - num10)))
			m1.M23 = ((num6 - (num * num6)) + (num2 * X))
			m1.M31 = ((num7 - (num * num7)) + (num2 * Y))
			m1.M32 = ((num6 - (num * num6)) - (num2 * X))
			m1.M33 = (num9 + (num * (1.0! - num9)))
			Return m1
		End Function
		Public Shared Function CreateFromQuaternion(ByVal q1 As Quaternion) As Matrix
			Dim m1 As Matrix = Matrix.Identity
			Dim num9 As Single = (q1.X * q1.X)
			Dim num8 As Single = (q1.Y * q1.Y)
			Dim num7 As Single = (q1.Z * q1.Z)
			Dim num6 As Single = (q1.X * q1.Y)
			Dim num5 As Single = (q1.Z * q1.W)
			Dim num4 As Single = (q1.Z * q1.X)
			Dim num3 As Single = (q1.Y * q1.W)
			Dim num2 As Single = (q1.Y * q1.Z)
			Dim num As Single = (q1.X * q1.W)
			m1.M11 = (1.0! - (2.0! * (num8 + num7)))
			m1.M12 = (2.0! * (num6 + num5))
			m1.M13 = (2.0! * (num4 - num3))
			m1.M21 = (2.0! * (num6 - num5))
			m1.M22 = (1.0! - (2.0! * (num7 + num9)))
			m1.M23 = (2.0! * (num2 + num))
			m1.M31 = (2.0! * (num4 + num3))
			m1.M32 = (2.0! * (num2 - num))
			m1.M33 = (1.0! - (2.0! * (num8 + num9)))
			Return m1
		End Function
		Public Shared Function CreateFromYawPitchRoll(ByVal yaw As Single, ByVal pitch As Single, ByVal roll As Single) As Matrix
			Dim m1 As Matrix
			Dim q1 As Quaternion
			Quaternion.CreateFromYawPitchRoll(yaw, pitch, roll, q1)
			Matrix.CreateFromQuaternion(q1, m1)
			Return m1
		End Function
		Public Shared Function CreateLookAt(ByVal pos As Vector3, ByVal tar As Vector3, ByVal up As Vector3) As Matrix
			Dim m1 As Matrix = Matrix.Identity
			Dim v1 As Vector3 = Vector3.Normalize(Vector3.Subtract(pos, tar))
			Dim v2 As Vector3 = Vector3.Normalize(Vector3.Cross(up, v1))
			Dim v3 As Vector3 = Vector3.Cross(v1, v2)
			m1.M11 = v2.X
			m1.M12 = v3.X
			m1.M13 = v1.X
			m1.M21 = v2.Y
			m1.M22 = v3.Y
			m1.M23 = v1.Y
			m1.M31 = v2.Z
			m1.M32 = v3.Z
			m1.M31 = v1.Z
			m1.M41 = -Vector3.Dot(v2, pos)
			m1.M42 = -Vector3.Dot(v3, pos)
			m1.M43 = -Vector3.Dot(v1, pos)
			Return m1
		End Function
		Public Shared Function CreateOrthographic(ByVal width As Single, ByVal height As Single, ByVal zNear As Single, ByVal zFar As Single) As Matrix
			Dim m1 As Matrix = Matrix.Identity
			m1.M11 = (2.0! / width)
			m1.M22 = (2.0! / height)
			m1.M33 = (1.0! / (zNear - zFar))
			m1.M43 = (zNear / (zNear - zFar))
			Return m1
		End Function
		Public Shared Function CreateOrthographicOffCenter(ByVal left As Single, ByVal right As Single, ByVal bottom As Single, ByVal top As Single, ByVal zNear As Single, ByVal zFar As Single) As Matrix
			Dim m1 As Matrix = Matrix.Identity
			m1.M11 = (2.0! / (right - left))
			m1.M22 = (2.0! / (top - bottom))
			m1.M33 = (2.0! / (zNear - zFar))
			m1.M41 = ((left + right) / (left - right))
			m1.M42 = ((top + bottom) / (bottom - top))
			m1.M43 = (zNear / (zNear - zFar))
			Return m1
		End Function
		Public Shared Function CreatePerspective(ByVal width As Single, ByVal height As Single, ByVal near As Single, ByVal far As Single) As Matrix
			If (near <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance has a negative value")
			End If
			If (far <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("farPlaneDistance has a negative value")
			End If
			If (near >= far) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance has the same distance as farPlaneDistance")
			End If
			Dim m1 As Matrix = New Matrix(0)
			m1.M11 = ((2.0! * near) / width)
			m1.M22 = ((2.0! * near) / height)
			m1.M33 = (far / (near - far))
			m1.M34 = -1.0!
			m1.M43 = ((near * far) / (near - far))
			Return m1
		End Function
		Public Shared Function CreatePerspectiveFieldOfView(ByVal fov As Single, ByVal aspect As Single, ByVal near As Single, ByVal far As Single) As Matrix
			If ((fov <= 0.0!) OrElse (fov >= 3.141593!)) Then
				Throw New ArgumentOutOfRangeException("Field of View is not within bounds")
			End If
			If (near <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance is not within range")
			End If
			If (far <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("farPlaneDistance is not within range")
			End If
			If (near >= far) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance is greater than the farPlaneDistance")
			End If
			Dim m1 As Matrix = New Matrix(0)
			Dim num As Single = (1.0! / CSng(Tan(CDbl((fov * 0.5!)))))
			Dim num9 As Single = (num / aspect)
			m1.M11 = num9
			m1.M22 = num
			m1.M33 = (far / (near - far))
			m1.M34 = -1.0!
			m1.M43 = ((near * far) / (near - far))
			Return m1
		End Function
		Public Shared Function CreatePerspectiveOffCenter(ByVal left As Single, ByVal right As Single, ByVal bottom As Single, ByVal top As Single, ByVal near As Single, ByVal far As Single) As Matrix
			If (near <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance is out of range")
			End If
			If (far <= 0.0!) Then
				Throw New ArgumentOutOfRangeException("farPlaneDistance is out of range")
			End If
			If (near >= far) Then
				Throw New ArgumentOutOfRangeException("nearPlaneDistance exceeds the farPlaneDistance")
			End If
			Dim m1 As Matrix = New Matrix(0)
			m1.M11 = ((2.0! * near) / (right - left))
			m1.M22 = ((2.0! * near) / (top - bottom))
			m1.M31 = ((left + right) / (right - left))
			m1.M32 = ((top + bottom) / (top - bottom))
			m1.M33 = (far / (near - far))
			m1.M34 = -1.0!
			m1.M43 = ((near * far) / (near - far))
			Return m1
		End Function
		Public Shared Function CreateReflections(ByVal value As Plane) As Matrix
			Dim m1 As Matrix = New Matrix(1)
			value.Normalize()
			Dim X As Single = value.Normalize.X
			Dim Y As Single = value.Normalize.Y
			Dim Z As Single = value.Normalize.Z
			Dim num3 As Single = (-2.0! * X)
			Dim num2 As Single = (-2.0! * Y)
			Dim num As Single = (-2.0! * Z)
			m1.M11 = ((num3 * X) + 1.0!)
			m1.M12 = (num2 * X)
			m1.M13 = (num * X)
			m1.M21 = (num3 * Y)
			m1.M22 = ((num2 * Y) + 1.0!)
			m1.M23 = (num * Y)
			m1.M31 = (num3 * Z)
			m1.M32 = (num2 * Z)
			m1.M33 = ((num * Z) + 1.0!)
			m1.M41 = (num3 * value.D)
			m1.M42 = (num2 * value.D)
			m1.M43 = (num * value.D)
			Return m1
		End Function
		Public Shared Function CreateRotationX(ByVal rads As Single) As Matrix
			Dim m1 As New Matrix(1)
			Dim num2 As Single = CSng(Cos(CDbl(rads)))
			Dim num As Single = CSng(Sin(CDbl(rads)))
			m1.M22 = num2
			m1.M23 = num
			m1.M32 = -num
			m1.M33 = num2
			Return m1
		End Function
		Public Shared Function CreateRotationY(ByVal rads As Single) As Matrix
			Dim m1 As New Matrix(1)
			Dim num2 As Single = CSng(Cos(CDbl(rads)))
			Dim num As Single = CSng(Sin(CDbl(rads)))
			m1.M11 = num2
			m1.M13 = -num
			m1.M31 = num
			m1.M33 = num2
			Return m1
		End Function
		Public Shared Function CreateRotationZ(ByVal rads As Single) As Matrix
			Dim m1 As New Matrix(1)
			Dim num2 As Single = CSng(Cos(CDbl(rads)))
			Dim num As Single = CSng(Sin(CDbl(rads)))
			m1.M11 = num2
			m1.M12 = num
			m1.M21 = -num
			m1.M22 = num2
			Return m1
		End Function
		Public Shared Function CreateScale(ByVal scale As Single) As Matrix
			Dim m1 As New Matrix(1)
			m1.M11 = scale
			m1.M22 = scale
			m1.M33 = scale
			Return m1
		End Function
		Public Shared Function CreateScale(ByVal scales As Vector3) As Matrix
			Dim m1 As New Matrix(1)
			Dim x As Single = scales.X
			Dim y As Single = scales.Y
			Dim z As Single = scales.Z
			m1.M11 = x
			m1.M22 = y
			m1.M33 = z
			Return m1
		End Function
		Public Shared Function CreateScale(ByVal xScale As Single, ByVal yScale As Single, ByVal zScale As Single) As Matrix
			Dim m1 As New Matrix(1)
			Dim num3 As Single = xScale
			Dim num2 As Single = yScale
			Dim num As Single = zScale
			m1.M11 = num3
			m1.M22 = num2
			m1.M33 = num
			Return m1
		End Function
		Public Shared Function CreateShadow(ByVal light As Vector3, ByVal p1 As Plane) As Matrix
			Dim p2 As Plane
			Plane.Normalize(p1, p2)
			Dim num As Single = (((p2.Normal.X * light.X) + (p2.Normal.Y * light.Y)) + (p2.Normal.Z * light.Z))
			Dim num5 As Single = -p2.Normal.X
			Dim num4 As Single = -p2.Normal.Y
			Dim num3 As Single = -p2.Normal.Z
			Dim num2 As Single = -p2.D
			Dim m1 As Matrix = New Matrix(0)
			m1.M11 = ((num5 * light.X) + num)
			m1.M21 = (num4 * light.X)
			m1.M31 = (num3 * light.X)
			m1.M41 = (num2 * light.X)
			m1.M12 = (num5 * light.Y)
			m1.M22 = ((num4 * light.Y) + num)
			m1.M32 = (num3 * light.Y)
			m1.M42 = (num2 * light.Y)
			m1.M13 = (num5 * light.Z)
			m1.M23 = (num4 * light.Z)
			m1.M33 = ((num3 * light.Z) + num)
			m1.M43 = (num2 * light.Z)
			m1.M44 = num
			Return m1
		End Function
		Public Shared Function CreateTranslation(ByVal pos As Vector3) As Matrix
			Dim m1 As New Matrix(1)
			m1.M41 = pos.X
			m1.M42 = pos.Y
			m1.M43 = pos.Z
		End Function
		Public Shared Function CreateTranslation(ByVal xpos As Single, ByVal ypos As Single, ByVal zpos As Single) As Matrix
			Dim m1 As New Matrix(1)
			m1.M41 = xpos
			m1.M42 = ypos
			m1.M43 = zpos
			Return m1
		End Function
		Public Shared Function CreateWorld(ByVal pos As Vector3, ByVal forw As Vector3, ByVal up As Vector3) As Matrix
			Dim m1 As Matrix = New Matrix(1)
			Dim v1 As Vector3 = Vector3.Normalize(Vector3.op_UnaryNegation(forw))
			Dim v2 As Vector3 = Vector3.Normalize(Vector3.Cross(up, v1))
			Dim v3 As Vector3 = Vector3.Cross(v1, v2)
			m1.M11 = v2.X
			m1.M12 = v2.Y
			m1.M13 = v2.Z
			m1.M21 = v3.X
			m1.M22 = v3.Y
			m1.M23 = v3.Z
			m1.M31 = v1.X
			m1.M32 = v1.Y
			m1.M33 = v1.Z
			m1.M41 = pos.X
			m1.M42 = pos.Y
			m1.M43 = pos.Z
			Return m1
		End Function
		Public Shared Function Divide(ByVal m1 As Matrix, ByVal factor As Single) As Matrix
			Dim m2 As Matrix
			m2.M11 = (m1.M11 / factor)
			m2.M12 = (m1.M12 / factor)
			m2.M13 = (m1.M13 / factor)
			m2.M14 = (m1.M14 / factor)
			m2.M21 = (m1.M21 / factor)
			m2.M22 = (m1.M22 / factor)
			m2.M23 = (m1.M23 / factor)
			m2.M24 = (m1.M24 / factor)
			m2.M31 = (m1.M31 / factor)
			m2.M32 = (m1.M32 / factor)
			m2.M33 = (m1.M33 / factor)
			m2.M34 = (m1.M34 / factor)
			m2.M41 = (m1.M41 / factor)
			m2.M42 = (m1.M42 / factor)
			m2.M43 = (m1.M43 / factor)
			m2.M44 = (m1.M44 / factor)
			Return m2
		End Function
		Public Shared Function Divide(ByVal m1 As Matrix, ByVal m2 As Matrix) As Matrix
			Dim m3 As Matrix
			m3.M11 = (m1.M11 / m2.M11)
			m3.M12 = (m1.M12 / m2.M12)
			m3.M13 = (m1.M13 / m2.M13)
			m3.M14 = (m1.M14 / m2.M14)
			m3.M21 = (m1.M21 / m2.M21)
			m3.M22 = (m1.M22 / m2.M22)
			m3.M23 = (m1.M23 / m2.M23)
			m3.M24 = (m1.M24 / m2.M24)
			m3.M31 = (m1.M31 / m2.M31)
			m3.M32 = (m1.M32 / m2.M32)
			m3.M33 = (m1.M33 / m2.M33)
			m3.M34 = (m1.M34 / m2.M34)
			m3.M41 = (m1.M41 / m2.M41)
			m3.M42 = (m1.M42 / m2.M42)
			m3.M43 = (m1.M43 / m2.M43)
			m3.M44 = (m1.M44 / m2.M44)
			Return m3
		End Function
		Public Shared Function Invert(ByVal m1 As Matrix) As Matrix
			Dim m2 As Matrix
			Dim num5 As Single = m1.M11
			Dim num4 As Single = m1.M12
			Dim num3 As Single = m1.M13
			Dim num2 As Single = m1.M14
			Dim num9 As Single = m1.M21
			Dim num8 As Single = m1.M22
			Dim num7 As Single = m1.M23
			Dim num6 As Single = m1.M24
			Dim num17 As Single = m1.M31
			Dim num16 As Single = m1.M32
			Dim num15 As Single = m1.M33
			Dim num14 As Single = m1.M34
			Dim num13 As Single = m1.M41
			Dim num12 As Single = m1.M42
			Dim num11 As Single = m1.M43
			Dim num10 As Single = m1.M44
			Dim num23 As Single = ((num15 * num10) - (num14 * num11))
			Dim num22 As Single = ((num16 * num10) - (num14 * num12))
			Dim num21 As Single = ((num16 * num11) - (num15 * num12))
			Dim num20 As Single = ((num17 * num10) - (num14 * num13))
			Dim num19 As Single = ((num17 * num11) - (num15 * num13))
			Dim num18 As Single = ((num17 * num12) - (num16 * num13))
			Dim num39 As Single = (((num8 * num23) - (num7 * num22)) + (num6 * num21))
			Dim num38 As Single = -(((num9 * num23) - (num7 * num20)) + (num6 * num19))
			Dim num37 As Single = (((num9 * num22) - (num8 * num20)) + (num6 * num18))
			Dim num36 As Single = -(((num9 * num21) - (num8 * num19)) + (num7 * num18))
			Dim num As Single = (1.0! / ((((num5 * num39) + (num4 * num38)) + (num3 * num37)) + (num2 * num36)))
			m2.M11 = (num39 * num)
			m2.M21 = (num38 * num)
			m2.M31 = (num37 * num)
			m2.M41 = (num36 * num)
			m2.M12 = (-(((num4 * num23) - (num3 * num22)) + (num2 * num21)) * num)
			m2.M22 = ((((num5 * num23) - (num3 * num20)) + (num2 * num19)) * num)
			m2.M32 = (-(((num5 * num22) - (num4 * num20)) + (num2 * num18)) * num)
			m2.M42 = ((((num5 * num21) - (num4 * num19)) + (num3 * num18)) * num)
			Dim num35 As Single = ((num7 * num10) - (num6 * num11))
			Dim num34 As Single = ((num8 * num10) - (num6 * num12))
			Dim num33 As Single = ((num8 * num11) - (num7 * num12))
			Dim num32 As Single = ((num9 * num10) - (num6 * num13))
			Dim num31 As Single = ((num9 * num11) - (num7 * num13))
			Dim num30 As Single = ((num9 * num12) - (num8 * num13))
			m2.M13 = ((((num4 * num35) - (num3 * num34)) + (num2 * num33)) * num)
			m2.M23 = (-(((num5 * num35) - (num3 * num32)) + (num2 * num31)) * num)
			m2.M33 = ((((num5 * num34) - (num4 * num32)) + (num2 * num30)) * num)
			m2.M43 = (-(((num5 * num33) - (num4 * num32)) + (num3 * num30)) * num)
			Dim num29 As Single = ((num7 * num14) - (num6 * num15))
			Dim num28 As Single = ((num8 * num14) - (num6 * num16))
			Dim num27 As Single = ((num8 * num15) - (num7 * num16))
			Dim num26 As Single = ((num9 * num14) - (num6 * num17))
			Dim num25 As Single = ((num9 * num15) - (num7 * num17))
			Dim num24 As Single = ((num9 * num16) - (num8 * num17))
			m2.M14 = (-(((num4 * num29) - (num3 * num28)) + (num2 * num27)) * num)
			m2.M24 = ((((num5 * num29) - (num3 * num26)) + (num2 * num25)) * num)
			m2.M34 = (-(((num5 * num28) - (num4 * num26)) + (num2 * num24)) * num)
			m2.M44 = ((((num5 * num27) - (num4 * num25)) + (num3 * num24)) * num)
			Return m2
		End Function
		Public Shared Function Lerp(ByVal m1 As Matrix, ByVal m2 As Matrix, ByVal factor As Single) As Matrix
			Dim m3 As Matrix
			m3.M11 = (m1.M11 + ((m2.M11 - m1.M11) * factor))
			m3.M12 = (m1.M12 + ((m2.M12 - m1.M12) * factor))
			m3.M13 = (m1.M13 + ((m2.M13 - m1.M13) * factor))
			m3.M14 = (m1.M14 + ((m2.M14 - m1.M14) * factor))
			m3.M21 = (m1.M21 + ((m2.M21 - m1.M21) * factor))
			m3.M22 = (m1.M22 + ((m2.M22 - m1.M22) * factor))
			m3.M23 = (m1.M23 + ((m2.M23 - m1.M23) * factor))
			m3.M24 = (m1.M24 + ((m2.M24 - m1.M24) * factor))
			m3.M31 = (m1.M31 + ((m2.M31 - m1.M31) * factor))
			m3.M32 = (m1.M32 + ((m2.M32 - m1.M32) * factor))
			m3.M33 = (m1.M33 + ((m2.M33 - m1.M33) * factor))
			m3.M34 = (m1.M34 + ((m2.M34 - m1.M34) * factor))
			m3.M41 = (m1.M41 + ((m2.M41 - m1.M41) * factor))
			m3.M42 = (m1.M42 + ((m2.M42 - m1.M42) * factor))
			m3.M43 = (m1.M43 + ((m2.M43 - m1.M43) * factor))
			m3.M44 = (m1.M44 + ((m2.M44 - m1.M44) * factor))
			Return m3
		End Function
		Public Shared Function Multiply(ByVal m1 As Matrix, ByVal m2 As Matrix) As Matrix
			Dim m3 As Matrix
			m3.M11 = ((((m1.M11 * m2.M11) + (m1.M12 * m2.M21)) + (m1.M13 * m2.M31)) + (m1.M14 * m2.M41))
			m3.M12 = ((((m1.M11 * m2.M12) + (m1.M12 * m2.M22)) + (m1.M13 * m2.M32)) + (m1.M14 * m2.M42))
			m3.M13 = ((((m1.M11 * m2.M13) + (m1.M12 * m2.M23)) + (m1.M13 * m2.M33)) + (m1.M14 * m2.M43))
			m3.M14 = ((((m1.M11 * m2.M14) + (m1.M12 * m2.M24)) + (m1.M13 * m2.M34)) + (m1.M14 * m2.M44))
			m3.M21 = ((((m1.M21 * m2.M11) + (m1.M22 * m2.M21)) + (m1.M23 * m2.M31)) + (m1.M24 * m2.M41))
			m3.M22 = ((((m1.M21 * m2.M12) + (m1.M22 * m2.M22)) + (m1.M23 * m2.M32)) + (m1.M24 * m2.M42))
			m3.M23 = ((((m1.M21 * m2.M13) + (m1.M22 * m2.M23)) + (m1.M23 * m2.M33)) + (m1.M24 * m2.M43))
			m3.M24 = ((((m1.M21 * m2.M14) + (m1.M22 * m2.M24)) + (m1.M23 * m2.M34)) + (m1.M24 * m2.M44))
			m3.M31 = ((((m1.M31 * m2.M11) + (m1.M32 * m2.M21)) + (m1.M33 * m2.M31)) + (m1.M34 * m2.M41))
			m3.M32 = ((((m1.M31 * m2.M12) + (m1.M32 * m2.M22)) + (m1.M33 * m2.M32)) + (m1.M34 * m2.M42))
			m3.M33 = ((((m1.M31 * m2.M13) + (m1.M32 * m2.M23)) + (m1.M33 * m2.M33)) + (m1.M34 * m2.M43))
			m3.M34 = ((((m1.M31 * m2.M14) + (m1.M32 * m2.M24)) + (m1.M33 * m2.M34)) + (m1.M34 * m2.M44))
			m3.M41 = ((((m1.M41 * m2.M11) + (m1.M42 * m2.M21)) + (m1.M43 * m2.M31)) + (m1.M44 * m2.M41))
			m3.M42 = ((((m1.M41 * m2.M12) + (m1.M42 * m2.M22)) + (m1.M43 * m2.M32)) + (m1.M44 * m2.M42))
			m3.M43 = ((((m1.M41 * m2.M13) + (m1.M42 * m2.M23)) + (m1.M43 * m2.M33)) + (m1.M44 * m2.M43))
			m3.M44 = ((((m1.M41 * m2.M14) + (m1.M42 * m2.M24)) + (m1.M43 * m2.M34)) + (m1.M44 * m2.M44))
			Return m3
		End Function
		Public Shared Function Multiply(ByVal m1 As Matrix, ByVal factor As Single) As Matrix
			Dim m2 As Matrix
			m2.M11 = (m1.M11 * factor)
			m2.M12 = (m1.M12 * factor)
			m2.M13 = (m1.M13 * factor)
			m2.M14 = (m1.M14 * factor)
			m2.M21 = (m1.M21 * factor)
			m2.M22 = (m1.M22 * factor)
			m2.M23 = (m1.M23 * factor)
			m2.M24 = (m1.M24 * factor)
			m2.M31 = (m1.M31 * factor)
			m2.M32 = (m1.M32 * factor)
			m2.M33 = (m1.M33 * factor)
			m2.M34 = (m1.M34 * factor)
			m2.M41 = (m1.M41 * factor)
			m2.M42 = (m1.M42 * factor)
			m2.M43 = (m1.M43 * factor)
			m2.M44 = (m1.M44 * factor)
			Return m2
		End Function
		Public Shared Function Negate(ByVal m1 As Matrix)
			Dim m2 As Matrix
			m2.M11 = -m1.M11
			m2.M12 = -m1.M12
			m2.M13 = -m1.M13
			m2.M14 = -m1.M14
			m2.M21 = -m1.M21
			m2.M22 = -m1.M22
			m2.M23 = -m1.M23
			m2.M24 = -m1.M24
			m2.M31 = -m1.M31
			m2.M32 = -m1.M32
			m2.M33 = -m1.M33
			m2.M34 = -m1.M34
			m2.M41 = -m1.M41
			m2.M42 = -m1.M42
			m2.M43 = -m1.M43
			m2.M44 = -m1.M44
			Return m2
		End Function
		Public Shared Function Subtract(ByVal m1 As Matrix, ByVal m2 As Matrix) As Matrix
			Dim m3 As Matrix
			m3.M11 = (m1.M11 - m2.M11)
			m3.M12 = (m1.M12 - m2.M12)
			m3.M13 = (m1.M13 - m2.M13)
			m3.M14 = (m1.M14 - m2.M14)
			m3.M21 = (m1.M21 - m2.M21)
			m3.M22 = (m1.M22 - m2.M22)
			m3.M23 = (m1.M23 - m2.M23)
			m3.M24 = (m1.M24 - m2.M24)
			m3.M31 = (m1.M31 - m2.M31)
			m3.M32 = (m1.M32 - m2.M32)
			m3.M33 = (m1.M33 - m2.M33)
			m3.M34 = (m1.M34 - m2.M34)
			m3.M41 = (m1.M41 - m2.M41)
			m3.M42 = (m1.M42 - m2.M42)
			m3.M43 = (m1.M43 - m2.M43)
			m3.M44 = (m1.M44 - m2.M44)
			Return m3
		End Function
		''' <summary>
		''' needs coding to be implemented
		''' </summary>
		''' <param name="val"></param>
		''' <param name="rot"></param>
		''' <returns></returns>
		''' <remarks></remarks>
		Public Shared Function Transform(ByVal val As Matrix, ByVal rot As Quaternion) As Matrix
			'needs coding
		End Function
		''' <summary>
		''' needs coding to be implemented
		''' </summary>
		''' <param name="m1"></param>
		''' <returns></returns>
		''' <remarks></remarks>
		Public Shared Function Transpose(ByVal m1 As Matrix) As Matrix
			'needs coding
		End Function
		Public Shadows Function Equals(ByVal other As Matrix) As Boolean Implements System.IEquatable(Of Matrix).Equals
			Return ((((((Me.M11 = other.M11) AndAlso (Me.M22 = other.M22)) AndAlso ((Me.M33 = other.M33) AndAlso (Me.M44 = other.M44))) AndAlso (((Me.M12 = other.M12) AndAlso (Me.M13 = other.M13)) AndAlso ((Me.M14 = other.M14) AndAlso (Me.M21 = other.M21)))) AndAlso ((((Me.M23 = other.M23) AndAlso (Me.M24 = other.M24)) AndAlso ((Me.M31 = other.M31) AndAlso (Me.M32 = other.M32))) AndAlso (((Me.M34 = other.M34) AndAlso (Me.M41 = other.M41)) AndAlso (Me.M42 = other.M42)))) AndAlso (Me.M43 = other.M43))
		End Function
		''' <summary>
		''' needs coding implementation
		''' </summary>
		''' <returns></returns>
		''' <remarks></remarks>
		Public Function Determinant() As Single
			'Need coding
		End Function
#End Region
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure ModelMeshPartCollection

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure Plane
		Implements IEquatable(Of Plane)
#Region "Variables"
		Public Normal As Vector3
		Public D As Single
#End Region
#Region "Constructors"
		Public Sub New(ByVal normal As Vector3, ByVal d As Single)
			Me.Normal = normal
			Me.D = d
		End Sub
		Public Sub New(ByVal a As Single, ByVal b As Single, ByVal c As Single, ByVal d As Single)
			Me.Normal.X = a
			Me.Normal.Y = b
			Me.Normal.X = c
			Me.D = d
		End Sub
		Public Sub New(ByVal pt1 As Vector3, ByVal pt2 As Vector3, ByVal pt3 As Vector3)
			Dim num10 As Single = (pt2.X - pt1.X)
			Dim num9 As Single = (pt2.Y - pt1.Y)
			Dim num8 As Single = (pt2.Z - pt1.Z)
			Dim num7 As Single = (pt3.X - pt1.X)
			Dim num6 As Single = (pt3.Y - pt1.Y)
			Dim num5 As Single = (pt3.Z - pt1.Z)
			Dim num4 As Single = ((num9 * num5) - (num8 * num6))
			Dim num3 As Single = ((num8 * num7) - (num10 * num5))
			Dim num2 As Single = ((num10 * num6) - (num9 * num7))
			Dim num11 As Single = (((num4 * num4) + (num3 * num3)) + (num2 * num2))
			Dim num As Single = (1.0! / CSng(Sqrt(CDbl(num11))))
			Me.Normal.X = (num4 * num)
			Me.Normal.Y = (num3 * num)
			Me.Normal.Z = (num2 * num)
			Me.D = -(((Me.Normal.X * pt1.X) + (Me.Normal.Y * pt1.Y)) + (Me.Normal.Z * pt1.Z))
		End Sub
#End Region
#Region "Methods"
		Public Shared Sub Normalize(ByVal p1 As Plane, <Out()> ByRef p2 As Plane)
			Dim num2 As Single = (((p1.Normal.X * p1.Normal.X) + (p1.Normal.Y * p1.Normal.Y)) + (p1.Normal.Z * p1.Normal.Z))
			If (Abs(CSng((num2 - 1.0!))) < 0.0000001192093!) Then
				p2.Normal = p1.Normal
				p2.D = p1.D
			Else
				Dim num As Single = (1.0! / CSng(Sqrt(CDbl(num2))))
				p2.Normal.X = (p1.Normal.X * num)
				p2.Normal.Y = (p1.Normal.Y * num)
				p2.Normal.Z = (p1.Normal.Z * num)
				p2.D = (p1.D * num)
			End If
		End Sub
		Public Shared Sub Transform(ByVal p1 As Plane, ByVal m1 As Matrix, <Out()> ByRef p2 As Plane)
			Dim m2 As Matrix
			Matrix.Invert(m1, m2)
			Dim x As Single = p1.Normal.X
			Dim y As Single = p1.Normal.Y
			Dim z As Single = p1.Normal.Z
			Dim d As Single = p1.D
			p2.Normal.X = ((((x * m2.M11) + (y * m2.M12)) + (z * m2.M13)) + (d * m2.M14))
			p2.Normal.Y = ((((y * m2.M21) + (y * m2.M22)) + (z * m2.M23)) + (d * m2.M24))
			p2.Normal.Z = ((((z * m2.M31) + (y * m2.M32)) + (z * m2.M33)) + (d * m2.M34))
			p2.D = ((((x * m2.M41) + (y * m2.M42)) + (z * m2.M43)) + (d * m2.M44))
		End Sub
		Public Shared Sub Transform(ByVal p1 As Plane, ByVal rot As Quaternion, <Out()> ByRef p2 As Plane)
			Dim num15 As Single = (rot.X + rot.Y)
			Dim num5 As Single = (rot.Y + rot.Y)
			Dim num As Single = (rot.Z + rot.Z)
			Dim num14 As Single = (rot.W * num15)
			Dim num13 As Single = (rot.W * num5)
			Dim num12 As Single = (rot.W * num)
			Dim num11 As Single = (rot.X * num15)
			Dim num10 As Single = (rot.X * num5)
			Dim num9 As Single = (rot.X * num)
			Dim num8 As Single = (rot.Y * num5)
			Dim num7 As Single = (rot.Y * num)
			Dim num6 As Single = (rot.Z * num)
			Dim num24 As Single = ((1.0! - num8) - num6)
			Dim num23 As Single = (num10 - num12)
			Dim num22 As Single = (num9 + num13)
			Dim num21 As Single = (num10 + num12)
			Dim num20 As Single = ((1.0! - num11) - num6)
			Dim num19 As Single = (num7 - num14)
			Dim num18 As Single = (num9 - num13)
			Dim num17 As Single = (num7 + num14)
			Dim num16 As Single = ((1.0! - num11) - num8)
			Dim x As Single = p1.Normal.X
			Dim y As Single = p1.Normal.Y
			Dim z As Single = p1.Normal.Z
			p2.Normal.X = (((x * num24) + (y * num23)) + (z * num22))
			p2.Normal.Y = (((x * num21) + (y * num20)) + (z * num19))
			p2.Normal.Z = (((x * num18) + (y * num17)) + (z * num16))
			p2.D = p1.D
		End Sub
		Public Sub Dot(ByVal v1 As Vector4, <Out()> ByRef result As Single)
			result = ((((Me.Normal.X * v1.X) + (Me.Normal.Y * v1.Y)) + (Me.Normal.Z * v1.Z)) + (Me.D * v1.W))
		End Sub
		Public Sub DotCoordinate(ByVal v1 As Vector3, <Out()> ByRef result As Single)
			result = ((((Me.Normal.X * v1.X) + (Me.Normal.Y * v1.Y)) + (Me.Normal.Z * v1.Z)) + Me.D)
		End Sub
		Public Sub DotNormal(ByVal v1 As Vector3, ByVal result As Single)
			result = (((Me.Normal.X * v1.X) + (Me.Normal.Y * v1.Y)) + (Me.Normal.Z * v1.Z))
		End Sub
		Public Sub Intersects(ByVal b1 As BoundingBox, <Out()> ByRef result As PlaneIntersectionType)
			Dim v1 As Vector3
			Dim v2 As Vector3
			v2.X = IIf((Me.Normal.X >= 0.0!), b1.Min.X, b1.Max.X)
			v2.Y = IIf((Me.Normal.Y >= 0.0!), b1.Min.Y, b1.Max.Y)
			v2.Z = IIf((Me.Normal.Z >= 0.0!), b1.Min.Z, b1.Max.Z)
			v1.X = IIf((Me.Normal.X >= 0.0!), b1.Max.X, b1.Min.X)
			v1.Y = IIf((Me.Normal.Y >= 0.0!), b1.Max.Y, b1.Min.Y)
			v1.Z = IIf((Me.Normal.Z >= 0.0!), b1.Max.Z, b1.Min.Z)
			Dim num As Single = (((Me.Normal.X * v2.X) + (Me.Normal.Y * v2.Y)) + (Me.Normal.Z * v2.Z))
			If ((num + Me.D) > 0.0!) Then
				result = PlaneIntersectionType.Front
			Else
				num = (((Me.Normal.X * v1.X) + (Me.Normal.Y * v1.Y)) + (Me.Normal.Z * v1.Z))
				If ((num + Me.D) < 0.0!) Then
					result = PlaneIntersectionType.Back
				Else
					result = PlaneIntersectionType.Intersecting
				End If
			End If
		End Sub
		Public Sub Intersects(ByVal s1 As BoundingSphere, <Out()> ByRef result As PlaneIntersectionType)
			Dim num2 As Single = (((s1.Center.X * Me.Normal.X) + (s1.Center.Y * Me.Normal.Y)) + (s1.Center.Z * Me.Normal.Z))
			Dim num As Single = (num2 + Me.D)
			If (num > s1.Radius) Then
				result = PlaneIntersectionType.Front
			ElseIf (num < -s1.Radius) Then
				result = PlaneIntersectionType.Back
			Else
				result = PlaneIntersectionType.Intersecting
			End If
		End Sub
		Public Sub Normalize()
			Dim num2 As Single = (((Me.Normal.X * Me.Normal.X) + (Me.Normal.Y * Me.Normal.Y)) + (Me.Normal.Z * Me.Normal.Z))
			If (Abs(CSng((num2 - 1.0!))) >= 0.0000001192093!) Then
				Dim num As Single = (1.0! / CSng(Sqrt(CDbl(num2))))
				Me.Normal.X = (Me.Normal.X * num)
				Me.Normal.Y = (Me.Normal.Y * num)
				Me.Normal.Z = (Me.Normal.Z * num)
				Me.D = (Me.D * num)
			End If
		End Sub
#End Region
#Region "Functions"
		Public Shared Function Normalize(ByVal p1 As Plane) As Plane
			Dim p2 As Plane
			Dim num2 As Single = (((p1.Normal.X * p1.Normal.X) + (p1.Normal.Y * p1.Normal.Y)) + (p1.Normal.Z * p1.Normal.Z))
			If (Abs(CSng((num2 - 1.0!))) < 0.0000001192093!) Then
				p2.Normal = p1.Normal
				p2.D = p1.D
				Return p2
			End If
			Dim num As Single = (1.0! / CSng(Sqrt(CDbl(num2))))
			p2.Normal.X = (p1.Normal.X * num)
			p2.Normal.Y = (p1.Normal.Y * num)
			p2.Normal.Z = (p1.Normal.Z * num)
			p2.D = (p1.D * num)
			Return p2
		End Function
		Public Shared Function Transform(ByVal p1 As Plane, ByVal m1 As Matrix) As Plane
			Dim p2 As Plane
			Dim m2 As Matrix
			Matrix.Invert(m1, m2)
			Dim x As Single = p1.Normal.X
			Dim y As Single = p1.Normal.Y
			Dim z As Single = p1.Normal.Z
			Dim d As Single = p1.D
			p2.Normal.X = ((((x * m2.M11) + (y * m2.M12)) + (z * m2.M13)) + (d * m2.M14))
			p2.Normal.Y = ((((y * m2.M21) + (y * m2.M22)) + (z * m2.M23)) + (d * m2.M24))
			p2.Normal.Z = ((((z * m2.M31) + (y * m2.M32)) + (z * m2.M33)) + (d * m2.M34))
			p2.D = ((((x * m2.M41) + (y * m2.M42)) + (z * m2.M43)) + (d * m2.M44))
			Return p2
		End Function
		Public Shared Function Transform(ByVal p1 As Plane, ByVal rot As Quaternion) As Plane
			Dim p2 As Plane
			Dim num15 As Single = (rot.X + rot.Y)
			Dim num5 As Single = (rot.Y + rot.Y)
			Dim num As Single = (rot.Z + rot.Z)
			Dim num14 As Single = (rot.W * num15)
			Dim num13 As Single = (rot.W * num5)
			Dim num12 As Single = (rot.W * num)
			Dim num11 As Single = (rot.X * num15)
			Dim num10 As Single = (rot.X * num5)
			Dim num9 As Single = (rot.X * num)
			Dim num8 As Single = (rot.Y * num5)
			Dim num7 As Single = (rot.Y * num)
			Dim num6 As Single = (rot.Z * num)
			Dim num24 As Single = ((1.0! - num8) - num6)
			Dim num23 As Single = (num10 - num12)
			Dim num22 As Single = (num9 + num13)
			Dim num21 As Single = (num10 + num12)
			Dim num20 As Single = ((1.0! - num11) - num6)
			Dim num19 As Single = (num7 - num14)
			Dim num18 As Single = (num9 - num13)
			Dim num17 As Single = (num7 + num14)
			Dim num16 As Single = ((1.0! - num11) - num8)
			Dim x As Single = p1.Normal.X
			Dim y As Single = p1.Normal.Y
			Dim z As Single = p1.Normal.Z
			p2.Normal.X = (((x * num24) + (y * num23)) + (z * num22))
			p2.Normal.Y = (((x * num21) + (y * num20)) + (z * num19))
			p2.Normal.Z = (((x * num18) + (y * num17)) + (z * num16))
			p2.D = p1.D
			Return p2
		End Function
		Public Function Dot(ByVal v1 As Vector4) As Single
			Return ((((Me.Normal.X * v1.X) + (Me.Normal.Y * v1.Y)) + (Me.Normal.Z * v1.Z)) + (Me.D * v1.W))
		End Function
		Public Function DotCoordinate(ByVal v1 As Vector3) As Single
			Return ((((Me.Normal.X * v1.X) + (Me.Normal.Y * v1.Y)) + (Me.Normal.Z * v1.Z)) + Me.D)
		End Function
		Public Function DotNormal(ByVal v1 As Vector3) As Single
			Return (((Me.Normal.X * v1.X) + (Me.Normal.Y * v1.Y)) + (Me.Normal.Z * v1.Z))
		End Function
		Public Function Intersects(ByVal b1 As BoundingBox) As PlaneIntersectionType
			Dim v1 As Vector3
			Dim v2 As Vector3
			v2.X = IIf((Me.Normal.X >= 0.0!), b1.Min.X, b1.Max.X)
			v2.Y = IIf((Me.Normal.Y >= 0.0!), b1.Min.Y, b1.Max.Y)
			v2.Z = IIf((Me.Normal.Z >= 0.0!), b1.Min.Z, b1.Max.Z)
			v1.X = IIf((Me.Normal.X >= 0.0!), b1.Max.X, b1.Min.X)
			v1.Y = IIf((Me.Normal.Y >= 0.0!), b1.Max.Y, b1.Min.Y)
			v1.Z = IIf((Me.Normal.Z >= 0.0!), b1.Max.Z, b1.Min.Z)
			Dim num As Single = (((Me.Normal.X * v2.X) + (Me.Normal.Y * v2.Y)) + (Me.Normal.Z * v2.Z))
			If ((num + Me.D) > 0.0!) Then
				Return PlaneIntersectionType.Front
			End If
			num = (((Me.Normal.X * v1.X) + (Me.Normal.Y * v1.Y)) + (Me.Normal.Z * v1.Z))
			If ((num + Me.D) < 0.0!) Then
				Return PlaneIntersectionType.Back
			End If
			Return PlaneIntersectionType.Intersecting
		End Function
		Public Function Intersects(ByVal f1 As BoundingFrustrum) As PlaneIntersectionType
			If (Nothing Is f1) Then
				Throw New ArgumentNullException("frustrum has no value")
			End If
			Return f1.Intersects(Me)
		End Function
		Public Function Intersects(ByVal s1 As BoundingSphere) As PlaneIntersectionType
			Dim num2 As Single = (((sphere.center.x * Me.Normal.X) + (sphere.Center.y * Me.Normal.Y)) + (sphere.center.z * Me.Normal.Z))
			Dim num As Single = (num2 + Me.D)
			If (num > s1.Radius) Then
				Return PlaneIntersectionType.Front
			End If
			If (num < -s1.Radius) Then
				Return PlaneIntersectionType.Back
			End If
			Return PlaneIntersectionType.Intersecting
		End Function
		Public Shadows Function Equals(ByVal other As Plane) As Boolean Implements System.IEquatable(Of Plane).Equals
			Return ((((Me.Normal.X = other.Normal.X) AndAlso (Me.Normal.Y = other.Normal.Y)) AndAlso (Me.Normal.Z = other.Normal.Z)) AndAlso (Me.D = other.D))
		End Function
		Public Overrides Function ToString() As String
			Dim currentCulture As CultureInfo = CultureInfo.CurrentCulture
            Return String.Format(currentCulture,"(Normal: {0}, D: {1})", New Object(){Me.Normal.ToString,Me.D.ToString(currentCulture))
		End Function
#End Region

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure Point

	End Structure
	''' <summary>
	''' Defines a 4-D Vector (x,y,z,w), which is used to efficiently rotate an object about the (x,y,z) vector by the angle theta, where w=cos(theta/2)
	''' </summary>
	''' <remarks></remarks>
	Public Structure Quaternion
		Implements IEquatable(Of Quaternion)
#Region "Variables"
		Public X As Single
		Public Y As Single
		Public Z As Single
		Public W As Single
		Private Shared _identity As Quaternion
#End Region
#Region "Properties"
		Public Shared ReadOnly Property Identity() As Quaternion
			Get
				Return Quaternion._identity
			End Get
		End Property
#End Region
#Region "Constructors"
		Shared Sub New()
			Quaternion._identity = New Quaternion(0.0!, 0.0!, 0.0!, 1.0!)
		End Sub
		Public Sub New(ByVal xCoord As Single, ByVal yCoord As Single, ByVal zCoord As Single, ByVal wCoord As Single)
			Me.X = xCoord
			Me.Y = yCoord
			Me.Z = zCoord
			Me.W = wCoord
		End Sub
		Public Sub New(ByVal v1 As Vector3, ByVal scalar As Single)
			Me.X = v1.X
			Me.Y = v1.Y
			Me.Z = v1.Z
			Me.W = scalar
		End Sub
#End Region
#Region "Methods"
		Public Shared Sub Add(ByVal q1 As Quaternion, ByVal q2 As Quaternion, <Out()> ByRef q3 As Quaternion)
			q3.X = (q1.X + q2.X)
			q3.Y = (q1.Y + q2.Y)
			q3.Z = (q1.Z + q2.Z)
			q3.W = (q1.W + q2.W)
		End Sub
		Public Shared Sub Concatenate(ByVal q1 As Quaternion, ByVal q2 As Quaternion, <Out()> ByRef q3 As Quaternion)
			Dim x As Single = q2.X
			Dim y As Single = q2.Y
			Dim z As Single = q2.Z
			Dim w As Single = q2.W
			Dim num4 As Single = q1.X
			Dim num3 As Single = q1.Y
			Dim num2 As Single = q1.Z
			Dim num As Single = q1.W
			Dim num12 As Single = ((y * num2) - (z * num3))
			Dim num11 As Single = ((z * num4) - (x * num2))
			Dim num10 As Single = ((x * num3) - (y * num4))
			Dim num9 As Single = (((x * num4) + (y * num3)) + (z * num2))
			q3.X = (((x * num) + (num4 * w)) + num12)
			q3.Y = (((y * num) + (num3 * w)) + num11)
			q3.Z = (((z * num) + (num2 * w)) + num10)
			q3.W = ((w * num) - num9)
		End Sub
		Public Shared Sub Conjugate(ByVal q1 As Quaternion, <Out()> ByRef q2 As Quaternion)
			q2.X = -q1.X
			q2.Y = -q1.Y
			q2.Z = -q1.Z
			q2.W = -q1.W
		End Sub
		Public Shared Sub CreateFromAxisAngle(ByVal axis As Vector3, ByVal angle As Single, <Out()> ByRef q1 As Quaternion)
			Dim num2 As Single = (angle * 0.5!)
			Dim num As Single = CSng(Sin(CDbl(num2)))
			Dim num3 As Single = CSng(Cos(CDbl(num2)))
			q1.X = (axis.X * num)
			q1.Y = (axis.Y * num)
			q1.Z = (axis.Z * num)
			q1.W = num3
		End Sub
		Public Shared Sub CreateFromRotationmatrix(ByVal m1 As Matrix, <Out()> ByRef q1 As Quaternion)
			Dim num8 As Single = ((m1.M11 + m1.M22) + m1.M33)
			If (num8 > 0.0!) Then
				Dim num As Single = CSng(Sqrt(CDbl((num8 + 1.0!))))
				q1.W = (num * 0.5!)
				num = (0.5! / q1.W)
				q1.X = ((m1.M23 - m1.M32) * num)
				q1.Y = ((m1.M31 - m1.M13) * num)
				q1.Z = ((m1.M12 - m1.M21) * num)
			End If
			If ((m1.M11 >= m1.M22) AndAlso (m1.M11 >= m1.M33)) Then
				Dim num7 As Single = CSng(Sqrt(CDbl((((1.0! + m1.M11) - m1.M22) - m1.M33))))
				Dim num4 As Single = (0.5! / num7)
				q1.X = (0.5! * num7)
				q1.Y = ((m1.M12 + m1.M21) * num4)
				q1.Z = ((m1.M13 + m1.M31) * num4)
				q1.W = ((m1.M23 - m1.M32) * num4)
			End If
			If (m1.M22 > m1.M33) Then
				Dim num6 As Single = CSng(Sqrt(CDbl((((1.0! + m1.M22) - m1.M11) - m1.M33))))
				Dim num3 As Single = (0.5! / num6)
				q1.X = ((m1.M21 + m1.M12) * num3)
				q1.Y = (0.5! * num6)
				q1.Z = ((m1.M32 + m1.M23) * num3)
				q1.W = ((m1.M31 - m1.M13) * num3)
			End If
			Dim num5 As Single = CSng(Sqrt(CDbl((((1.0! + m1.M33) - m1.M11) - m1.M22))))
			Dim num2 As Single = (0.5! / num5)
			q1.X = ((m1.M31 + m1.M13) * num2)
			q1.Y = ((m1.M32 + m1.M23) * num2)
			q1.Z = (0.5! / num5)
			q1.W = ((m1.M12 - m1.M21) * num2)
		End Sub
		Public Shared Sub CreateFromYawPitchRoll(ByVal yaw As Single, ByVal pitch As Single, ByVal roll As Single, <Out()> ByRef q1 As Quaternion)
			Dim num9 As Single = roll * 0.5!
			Dim num6 As Single = CSng(Sin(CDbl(num9)))
			Dim num5 As Single = CSng(Cos(CDbl(num9)))
			Dim num8 As Single = pitch * 0.5!
			Dim num4 As Single = CSng(Sin(CDbl(num8)))
			Dim num3 As Single = CSng(Cos(CDbl(num8)))
			Dim num7 As Single = yaw * 0.5!
			Dim num2 As Single = CSng(Sin(CDbl(num7)))
			Dim num As Single = CSng(Cos(CDbl(num7)))
			q1.X = (((num * num4) * num5) + ((num2 * num3) * num6))
			q1.Y = (((num2 * num3) * num5) - ((num * num4) * num6))
			q1.Z = (((num * num3) * num6) - ((num2 * num4) * num5))
			q1.W = (((num * num3) * num5) + ((num2 * num4) * num6))
		End Sub
		Public Shared Sub Divide(ByVal q1 As Quaternion, ByVal q2 As Quaternion, <Out()> ByRef q3 As Quaternion)
			Dim x As Single = q1.X
			Dim y As Single = q1.Y
			Dim z As Single = q1.Z
			Dim w As Single = q1.W
			Dim num14 As Single = ((((q2.X * q2.X) + (q2.Y * q2.Y)) + (q2.Z * q2.Z)) + (q2.W * q2.W))
			Dim num5 As Single = (1.0! / num14)
			Dim num4 As Single = (-q2.X * num5)
			Dim num3 As Single = (-q2.Y * num5)
			Dim num2 As Single = (-q2.Z * num5)
			Dim num As Single = (q2.W * num5)
			Dim num13 As Single = ((y * num2) - (z * num3))
			Dim num12 As Single = ((z * num4) - (x * num2))
			Dim num11 As Single = ((x * num3) - (y * num4))
			Dim num10 As Single = (((x * num4) + (y * num3)) + (z * num2))
			q3.X = (((x * num) + (num4 * w)) + num13)
			q3.Y = (((y * num) + (num3 * w)) + num12)
			q3.Z = (((z * num) + (num2 * w)) + num11)
			q3.W = ((w * num) - num10)
		End Sub
		Public Shared Sub Dot(ByVal q1 As Quaternion, ByVal q2 As Quaternion, <Out()> ByRef result As Single)
			result = ((((q1.X * q2.Y) + (q1.Y * q2.Y)) + (q1.Z * q2.Z)) + (q1.W * q2.W))
		End Sub
		Public Shared Sub Inverse(ByVal q1 As Quaternion, <Out()> ByRef q2 As Quaternion)
			Dim num2 As Single = ((((q1.X * q1.X) + (q1.Y * q1.Y)) + (q1.Z * q1.Z)) + (q1.W * q1.W))
			Dim num As Single = (1.0! / num2)
			q2.X = (-q1.X * num)
			q2.Y = (-q1.Y * num)
			q2.Z = (-q1.Z * num)
			q2.W = (q1.W * num)
		End Sub
		Public Shared Sub Lerp(ByVal q1 As Quaternion, ByVal q2 As Quaternion, ByVal amt As Single, <Out()> ByRef q3 As Quaternion)
			Dim num As Single = amt
			Dim num2 As Single = (1.0! - num)
			Dim num5 As Single = ((((q1.X * q2.X) + (q1.Y * q2.Y)) + (q1.Z * q2.Z)) + (q1.W * q2.W))
			If (num5 >= 0.0!) Then
				q3.X = ((num2 * q1.X) + (num * q2.X))
				q3.Y = ((num2 * q1.Y) + (num * q2.Y))
				q3.Z = ((num2 * q1.Z) + (num * q2.Z))
				q3.W = ((num2 * q1.W) + (num * q2.W))
			Else
				q3.X = ((num2 * q1.X) - (num * q2.X))
				q3.Y = ((num2 * q1.Y) - (num * q2.Y))
				q3.Z = ((num2 * q1.Z) - (num * q2.Z))
				q3.W = ((num2 * q1.W) - (num * q2.W))
			End If
			Dim num4 As Single = ((((q3.X * q3.X) + (q3.Y * q3.Y)) + (q3.Z * q3.Z)) + (q3.W * q3.W))
			Dim num3 As Single = (1.0! / CSng(Sqrt(CDbl(num4))))
			q3.X = (q3.X * num3)
			q3.Y = (q3.Y * num3)
			q3.Z = (q3.Z * num3)
			q3.W = (q3.W * num3)
		End Sub
		Public Shared Sub Multiply(ByVal q1 As Quaternion, ByVal scale As Single, <Out()> ByRef q2 As Quaternion)
			q2.X = (q1.X * scale)
			q2.Y = (q1.Y * scale)
			q2.Z = (q1.Z * scale)
			q2.W = (q1.W * scale)
		End Sub
		Public Shared Sub Multiply(ByVal q1 As Quaternion, ByVal q2 As Quaternion, <Out()> ByRef q3 As Quaternion)
			Dim x As Single = q1.X
			Dim y As Single = q1.Y
			Dim z As Single = q1.Z
			Dim w As Single = q1.W
			Dim num4 As Single = q2.X
			Dim num3 As Single = q2.Y
			Dim num2 As Single = q2.Z
			Dim num As Single = q2.W
			Dim num12 As Single = ((y * num2) - (z * num3))
			Dim num11 As Single = ((z * num4) - (x * num2))
			Dim num10 As Single = ((x * num3) - (y * num4))
			Dim num9 As Single = (((x * num4) + (y * num3)) + (z * num2))
			q3.X = (((x * num) + (num4 * w)) + num12)
			q3.Y = (((y * num) + (num3 * w)) + num11)
			q3.Z = (((z * num) + (num2 * w)) + num10)
			q3.W = ((w * num) - num9)
		End Sub
		Public Shared Sub Negate(ByVal q1 As Quaternion, <Out()> ByRef q2 As Quaternion)
			q2.X = -q1.X
			q2.Y = -q1.Y
			q2.Z = -q1.Z
			q2.W = -q1.W
		End Sub
		Public Shared Sub Normalize(ByVal q1 As Quaternion, <Out()> ByRef q2 As Quaternion)
			Dim num2 As Single = ((((q1.X * q1.X) + (q1.Y * q1.Y)) + (q1.Z * q1.Z)) + (q1.W * q1.W))
			Dim num As Single = (1.0! / CSng(Sqrt(CDbl(num2))))
			q2.X = (q1.X * num)
			q2.Y = (q1.Y * num)
			q2.Z = (q1.Z * num)
			q2.W = (q1.W * num)
		End Sub
		Public Shared Sub Slerp(ByVal q1 As Quaternion, ByVal q2 As Quaternion, ByVal amt As Single, <Out()> ByRef q3 As Quaternion)
			Dim num2, num3 As Single
			Dim num As Single = amt
			Dim num4 As Single = ((((q1.X * q2.X) + (q1.Y * q2.Y)) + (q1.Z * q2.Z)) + (q1.W * q2.W))
			Dim flag As Boolean = False
			If (num4 < 0.0!) Then
				flag = True
				num4 = -num4
			End If
			If (num4 > 0.999999!) Then
				num3 = (1.0! - num)
				num2 = IIf(flag, -num, num)
			Else
				Dim num5 As Single = CSng(Acos(CDbl(num4)))
				Dim num6 As Single = CSng((1 / Sin(CDbl(num5))))
				num3 = (CSng(Sin(CDbl(((1.0! - num) * num5)))) * num6)
				num2 = IIf(flag, (CSng(-Sin(CDbl((num * num5)))) * num6), (CSng(Sin(CDbl((num * num5)))) * num6))
			End If
			q3.X = ((num3 * q1.X) + (num2 * q2.X))
			q3.Y = ((num3 * q1.Y) + (num2 * q2.Y))
			q3.Z = ((num3 * q1.Z) + (num2 * q2.Z))
			q3.W = ((num3 * q1.W) + (num2 * q2.W))
		End Sub
		Public Shared Sub Subtract(ByVal q1 As Quaternion, ByVal q2 As Quaternion, <Out()> ByRef q3 As Quaternion)
			q3.X = (q1.X - q2.X)
			q3.Y = (q1.Y - q2.Y)
			q3.Z = (q1.Z - q2.Z)
		End Sub
		Public Sub Conjugate()
			Me.X = -Me.X
			Me.Y = -Me.Y
			Me.Z = -Me.Z
		End Sub
		Public Sub Normalize()
			Dim num2 As Single = CSng((((Me.X * Me.X) + (Me.Y * Me.Y)) + (Me.Z * Me.Z)) + (Me.W * Me.W))
			Dim num As Single = (1.0! / CSng(Sqrt(CDbl(num2))))
			Me.X = (Me.X * num)
			Me.Y = (Me.Y * num)
			Me.Z = (Me.Z * num)
			Me.W = (Me.W * num)
		End Sub
#End Region
#Region "Functions"
		Public Shared Function Add(ByVal q1 As Quaternion, ByVal q2 As Quaternion) As Quaternion
			Dim q3 As Quaternion
			q3.X = (q1.X + q2.X)
			q3.Y = (q1.Y + q2.Y)
			q3.Z = (q1.Z + q2.Z)
			q3.W = (q1.W + q2.W)
			Return q3
		End Function
		Public Shared Function Concatenate(ByVal q1 As Quaternion, ByVal q2 As Quaternion) As Quaternion
			Dim q3 As Quaternion
			Dim x As Single = q2.X
			Dim y As Single = q2.Y
			Dim z As Single = q2.Z
			Dim w As Single = q2.W
			Dim num4 As Single = q1.X
			Dim num3 As Single = q1.Y
			Dim num2 As Single = q1.Z
			Dim num As Single = q1.W
			Dim num12 As Single = ((y * num2) - (z * num3))
			Dim num11 As Single = ((z * num4) - (x * num2))
			Dim num10 As Single = ((x * num3) - (y * num4))
			Dim num9 As Single = (((x * num4) + (y * num3)) + (z * num2))
			q3.X = (((x * num) + (num4 * w)) + num12)
			q3.Y = (((y * num) + (num3 * w)) + num11)
			q3.Z = (((z * num) + (num2 * w)) + num10)
			q3.W = ((w * num) - num9)
			Return q3
		End Function
		Public Shared Function Conjugate(ByVal q1 As Quaternion) As Quaternion
			Dim q2 As Quaternion
			q2.X = -q1.X
			q2.Y = -q1.Y
			q2.Z = -q1.Z
			q2.W = -q1.W
			Return q2
		End Function
		Public Shared Function CreateFromAxisAngle(ByVal axis As Vector3, ByVal angle As Single) As Quaternion
			Dim q1 As Quaternion
			Dim num2 As Single = (angle * 0.5!)
			Dim num As Single = CSng(Sin(CDbl(num2)))
			Dim num3 As Single = CSng(Cos(CDbl(num2)))
			q1.X = (axis.X * num)
			q1.Y = (axis.Y * num)
			q1.Z = (axis.Z * num)
			q1.W = num3
			Return q1
		End Function
		Public Shared Function CreateFromRotationmatrix(ByVal m1 As Matrix) As Quaternion
			Dim num8 As Single = ((m1.M11 + m1.M22) + m1.M33)
			Dim q1 As New Quaternion
			If (num8 > 0.0!) Then
				Dim num As Single = CSng(Sqrt(CDbl((num8 + 1.0!))))
				q1.W = (num * 0.5!)
				num = (0.5! / q1.W)
				q1.X = ((m1.M23 - m1.M32) * num)
				q1.Y = ((m1.M31 - m1.M13) * num)
				q1.Z = ((m1.M12 - m1.M21) * num)
				Return q1
			End If
			If ((m1.M11 >= m1.M22) AndAlso (m1.M11 >= m1.M33)) Then
				Dim num7 As Single = CSng(Sqrt(CDbl((((1.0! + m1.M11) - m1.M22) - m1.M33))))
				Dim num4 As Single = (0.5! / num7)
				q1.X = (0.5! * num7)
				q1.Y = ((m1.M12 + m1.M21) * num4)
				q1.Z = ((m1.M13 + m1.M31) * num4)
				q1.W = ((m1.M23 - m1.M32) * num4)
				Return q1
			End If
			If (m1.M22 > m1.M33) Then
				Dim num6 As Single = CSng(Sqrt(CDbl((((1.0! + m1.M22) - m1.M11) - m1.M33))))
				Dim num3 As Single = (0.5! / num6)
				q1.X = ((m1.M21 + m1.M12) * num3)
				q1.Y = (0.5! * num6)
				q1.Z = ((m1.M32 + m1.M23) * num3)
				q1.W = ((m1.M31 - m1.M13) * num3)
				Return q1
			End If
			Dim num5 As Single = CSng(Sqrt(CDbl((((1.0! + m1.M33) - m1.M11) - m1.M22))))
			Dim num2 As Single = (0.5! / num5)
			q1.X = ((m1.M31 + m1.M13) * num2)
			q1.Y = ((m1.M32 + m1.M23) * num2)
			q1.Z = (0.5! / num5)
			q1.W = ((m1.M12 - m1.M21) * num2)
			Return q1
		End Function
		Public Shared Function CreateFromYawPitchRoll(ByVal yaw As Single, ByVal pitch As Single, ByVal roll As Single) As Quaternion
			Dim q1 As Quaternion
			Dim num9 As Single = roll * 0.5!
			Dim num6 As Single = CSng(Sin(CDbl(num9)))
			Dim num5 As Single = CSng(Cos(CDbl(num9)))
			Dim num8 As Single = pitch * 0.5!
			Dim num4 As Single = CSng(Sin(CDbl(num8)))
			Dim num3 As Single = CSng(Cos(CDbl(num8)))
			Dim num7 As Single = yaw * 0.5!
			Dim num2 As Single = CSng(Sin(CDbl(num7)))
			Dim num As Single = CSng(Cos(CDbl(num7)))
			q1.X = (((num * num4) * num5) + ((num2 * num3) * num6))
			q1.Y = (((num2 * num3) * num5) - ((num * num4) * num6))
			q1.Z = (((num * num3) * num6) - ((num2 * num4) * num5))
			q1.W = (((num * num3) * num5) + ((num2 * num4) * num6))
			Return q1
		End Function
		Public Shared Function Divide(ByVal q1 As Quaternion, ByVal q2 As Quaternion) As Quaternion
			Dim q3 As Quaternion
			Dim x As Single = q1.X
			Dim y As Single = q1.Y
			Dim z As Single = q1.Z
			Dim w As Single = q1.W
			Dim num14 As Single = ((((q2.X * q2.X) + (q2.Y * q2.Y)) + (q2.Z * q2.Z)) + (q2.W * q2.W))
			Dim num5 As Single = (1.0! / num14)
			Dim num4 As Single = (-q2.X * num5)
			Dim num3 As Single = (-q2.Y * num5)
			Dim num2 As Single = (-q2.Z * num5)
			Dim num As Single = (q2.W * num5)
			Dim num13 As Single = ((y * num2) - (z * num3))
			Dim num12 As Single = ((z * num4) - (x * num2))
			Dim num11 As Single = ((x * num3) - (y * num4))
			Dim num10 As Single = (((x * num4) + (y * num3)) + (z * num2))
			q3.X = (((x * num) + (num4 * w)) + num13)
			q3.Y = (((y * num) + (num3 * w)) + num12)
			q3.Z = (((z * num) + (num2 * w)) + num11)
			q3.W = ((w * num) - num10)
			Return q3
		End Function
		Public Shared Function Dot(ByVal q1 As Quaternion, ByVal q2 As Quaternion) As Single
			Return ((((q1.X * q2.Y) + (q1.Y * q2.Y)) + (q1.Z * q2.Z)) + (q1.W * q2.W))
		End Function
		Public Shared Function Inverse(ByVal q1 As Quaternion) As Quaternion
			Dim q2 As Quaternion
			Dim num2 As Single = ((((q1.X * q1.X) + (q1.Y * q1.Y)) + (q1.Z * q1.Z)) + (q1.W * q1.W))
			Dim num As Single = (1.0! / num2)
			q2.X = (-q1.X * num)
			q2.Y = (-q1.Y * num)
			q2.Z = (-q1.Z * num)
			q2.W = (q1.W * num)
			Return q2
		End Function
		Public Shared Function Lerp(ByVal q1 As Quaternion, ByVal q2 As Quaternion, ByVal amt As Single) As Quaternion
			Dim num As Single = amt
			Dim num2 As Single = (1.0! - num)
			Dim q3 As New Quaternion
			Dim num5 As Single = ((((q1.X * q2.X) + (q1.Y * q2.Y)) + (q1.Z * q2.Z)) + (q1.W * q2.W))
			If (num5 >= 0.0!) Then
				q3.X = ((num2 * q1.X) + (num * q2.X))
				q3.Y = ((num2 * q1.Y) + (num * q2.Y))
				q3.Z = ((num2 * q1.Z) + (num * q2.Z))
				q3.W = ((num2 * q1.W) + (num * q2.W))
			Else
				q3.X = ((num2 * q1.X) - (num * q2.X))
				q3.Y = ((num2 * q1.Y) - (num * q2.Y))
				q3.Z = ((num2 * q1.Z) - (num * q2.Z))
				q3.W = ((num2 * q1.W) - (num * q2.W))
			End If
			Dim num4 As Single = ((((q3.X * q3.X) + (q3.Y * q3.Y)) + (q3.Z * q3.Z)) + (q3.W * q3.W))
			Dim num3 As Single = (1.0! / CSng(Sqrt(CDbl(num4))))
			q3.X = (q3.X * num3)
			q3.Y = (q3.Y * num3)
			q3.Z = (q3.Z * num3)
			q3.W = (q3.W * num3)
			Return q3
		End Function
		Public Shared Function Multiply(ByVal q1 As Quaternion, ByVal scale As Single) As Quaternion
			Dim q2 As Quaternion
			q2.X = (q1.X * scale)
			q2.Y = (q1.Y * scale)
			q2.Z = (q1.Z * scale)
			q2.W = (q1.W * scale)
			Return q2
		End Function
		Public Shared Function Multiply(ByVal q1 As Quaternion, ByVal q2 As Quaternion) As Quaternion
			Dim q3 As Quaternion
			Dim x As Single = q1.X
			Dim y As Single = q1.Y
			Dim z As Single = q1.Z
			Dim w As Single = q1.W
			Dim num4 As Single = q2.X
			Dim num3 As Single = q2.Y
			Dim num2 As Single = q2.Z
			Dim num As Single = q2.W
			Dim num12 As Single = ((y * num2) - (z * num3))
			Dim num11 As Single = ((z * num4) - (x * num2))
			Dim num10 As Single = ((x * num3) - (y * num4))
			Dim num9 As Single = (((x * num4) + (y * num3)) + (z * num2))
			q3.X = (((x * num) + (num4 * w)) + num12)
			q3.Y = (((y * num) + (num3 * w)) + num11)
			q3.Z = (((z * num) + (num2 * w)) + num10)
			q3.W = ((w * num) - num9)
			Return q3
		End Function
		Public Shared Function Negate(ByVal q1 As Quaternion) As Quaternion
			Dim q2 As Quaternion
			q2.X = -q1.X
			q2.Y = -q1.Y
			q2.Z = -q1.Z
			q2.W = -q1.W
			Return q2
		End Function
		Public Shared Function Normalize(ByVal q1 As Quaternion) As Quaternion
			Dim q2 As Quaternion
			Dim num2 As Single = ((((q1.X * q1.X) + (q1.Y * q1.Y)) + (q1.Z * q1.Z)) + (q1.W * q1.W))
			Dim num As Single = (1.0! / CSng(Sqrt(CDbl(num2))))
			q2.X = (q1.X * num)
			q2.Y = (q1.Y * num)
			q2.Z = (q1.Z * num)
			q2.W = (q1.W * num)
			Return q2
		End Function
		Public Shared Function Slerp(ByVal q1 As Quaternion, ByVal q2 As Quaternion, ByVal amt As Single) As Quaternion
			Dim num2, num3 As Single
			Dim q3 As Quaternion
			Dim num As Single = amt
			Dim num4 As Single = ((((q1.X * q2.X) + (q1.Y * q2.Y)) + (q1.Z * q2.Z)) + (q1.W * q2.W))
			Dim flag As Boolean = False
			If (num4 < 0.0!) Then
				flag = True
				num4 = -num4
			End If
			If (num4 > 0.999999!) Then
				num3 = (1.0! - num)
				num2 = IIf(flag, -num, num)
			Else
				Dim num5 As Single = CSng(Acos(CDbl(num4)))
				Dim num6 As Single = CSng((1 / Sin(CDbl(num5))))
				num3 = (CSng(Sin(CDbl(((1.0! - num) * num5)))) * num6)
				num2 = IIf(flag, (CSng(-Sin(CDbl((num * num5)))) * num6), (CSng(Sin(CDbl((num * num5)))) * num6))
			End If
			q3.X = ((num3 * q1.X) + (num2 * q2.X))
			q3.Y = ((num3 * q1.Y) + (num2 * q2.Y))
			q3.Z = ((num3 * q1.Z) + (num2 * q2.Z))
			q3.W = ((num3 * q1.W) + (num2 * q2.W))
			Return q3
		End Function
		Public Shared Function Subtract(ByVal q1 As Quaternion, ByVal q2 As Quaternion) As Quaternion
			Dim q3 As Quaternion
			q3.X = (q1.X - q2.X)
			q3.Y = (q1.Y - q2.Y)
			q3.Z = (q1.Z - q2.Z)
			Return q3
		End Function
		Public Function Length() As Single
			Return CSng(Sqrt(CDbl((((Me.X * Me.X) + (Me.Y * Me.Y)) + (Me.Z * Me.Z)) + (Me.W * Me.W))))
		End Function
		Public Function LengthSquared() As Single
			Return ((((Me.X * Me.X) + (Me.Y * Me.Y)) + (Me.Z * Me.Z)) + (Me.W * Me.W))
		End Function
		Public Overrides Function ToString() As String
			Dim currentCulture As CultureInfo = CultureInfo.CurrentCulture
			Return String.Format(currentCulture, "{(X:{0}, Y:{1}, Z:{2}, W:{3})}", New Object() {Me.X.ToString(currentCulture), Me.Y.ToString(currentCulture), Me.Z.ToString(currentCulture), Me.W.ToString(currentCulture)})
		End Function
		Public Shadows Function Equals(ByVal other As Quaternion) As Boolean Implements System.IEquatable(Of Quaternion).Equals
			Return ((((Me.X = other.X) AndAlso (Me.Y = other.Y)) AndAlso (Me.Z = other.Z)) AndAlso (Me.W = other.W))
		End Function
#End Region
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure RasterStatus

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure Ray

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure Rectangle

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure Vector2
		Implements IEquatable(Of Vector2)
#Region "Variables"
		Public X As Single
		Public Y As Single
		Private Shared _zero As Vector2
		Private Shared _one As Vector2
		Private Shared _unitX As Vector2
		Private Shared _unitY As Vector2
#End Region
#Region "Properties"
		''' <summary>
		''' Returns a Vector2 object with both X and Y set to 1
		''' </summary>
		''' <returns>Vector2 object</returns>
		''' <remarks></remarks>
		Public Shared ReadOnly Property One() As Vector2
			Get
				Return Vector2._one
			End Get
		End Property
		''' <summary>
		''' Returns a Vector2 object with both X and Y set to 0
		''' </summary>
		''' <returns>Vector2 object</returns>
		''' <remarks></remarks>
		Public Shared ReadOnly Property Zero() As Vector2
			Get
				Return Vector2._zero
			End Get
		End Property
		''' <summary>
		''' Returns the unit vector of X only, which is (1,0)
		''' </summary>
		''' <returns>Vector2 object</returns>
		''' <remarks></remarks>
		Public Shared ReadOnly Property UnitX() As Vector2
			Get
				Return Vector2._unitX
			End Get
		End Property
		''' <summary>
		''' Returns the unit vector of Y only, which is (0,1)
		''' </summary>
		''' <returns>Vector2 object</returns>
		''' <remarks></remarks>
		Public Shared ReadOnly Property UnitY() As Vector2
			Get
				Return Vector2._unitY
			End Get
		End Property
#End Region
#Region "Constructors"
		Shared Sub New()
			Vector2._zero = New Vector2(0.0!, 0.0!)
			Vector2._one = New Vector2(1.0!, 1.0!)
			Vector2._unitX = New Vector2(1.0!, 0.0!)
			Vector2._unitY = New Vector2(0.0!, 1.0!)
		End Sub
		''' <summary>
		''' Sets up a New Vector2 object with the X and Y properties set to value
		''' </summary>
		''' <param name="value">Single precision value</param>
		''' <remarks></remarks>
		Public Sub New(ByVal value As Single)
			Me.X = Me.Y = value
		End Sub
		''' <summary>
		''' Sets up a new Vector2 object with X and Y properties.
		''' </summary>
		''' <param name="xVal">Single precision value</param>
		''' <param name="yVal">Single precision value</param>
		''' <remarks></remarks>
		Public Sub New(ByVal xVal As Single, ByVal yVal As Single)
			Me.X = xVal
			Me.Y = yVal
		End Sub
#End Region
#Region "Methods"
		Public Shared Sub Add(ByVal v1 As Vector2, ByVal v2 As Vector2, <Out()> ByRef v3 As Vector2)
			v3.X = v1.X + v2.X
			v3.Y = v1.Y + v2.Y
		End Sub
		Public Shared Sub Barycentric(ByVal v1 As Vector2, ByVal v2 As Vector2, ByVal v3 As Vector2, ByVal b2 As Single, ByVal b3 As Single, <Out()> ByRef tv As Vector2)
			tv.X = v1.X + (b2 * (v2.X - v1.X)) + (b3 * (v3.X - v1.X))
			tv.Y = v1.Y + (b2 * (v2.Y - v1.Y)) + (b3 * (v3.Y - v1.Y))
		End Sub
		Public Shared Sub CatmullRom(ByVal v1 As Vector2, ByVal v2 As Vector2, ByVal v3 As Vector2, ByVal v4 As Vector2, ByVal b1 As Single, <Out()> ByRef vector As Vector2)
			Dim num As Single = b1 * b1
			Dim num2 As Single = b1 * num
			vector.X = (0.5! * ((((2.0! * v2.X) + ((-v1.X + v3.X) * b1)) + (((((2.0! * v1.X) - (5.0! * v2.X)) + (4.0! * v3.X)) - v4.X) * num)) + ((((-v1.X + (3.0! * v2.X)) - (3.0! * v3.X)) + v4.X) * num2)))
			vector.Y = (0.5! * ((((2.0! * v2.Y) + ((-v1.Y + v3.Y) * b1)) + (((((2.0! * v1.Y) - (5.0! * v2.Y)) + (4.0! * v3.Y)) - v4.Y) * num)) + ((((-v1.Y + (3.0! * v2.Y)) - (3.0! * v3.Y)) + v4.Y) * num2)))
		End Sub
		Public Shared Sub Clamp(ByVal v1 As Vector2, ByVal min As Vector2, ByVal max As Vector2, <Out()> ByRef v2 As Vector2)
			Dim x As Single = v1.X
			x = IIf(x > max.X, max.X, x)
			x = IIf(x < min.X, min.X, x)
			Dim y As Single = v1.Y
			y = IIf(y > max.Y, max.Y, y)
			y = IIf(y < min.Y, min.Y, y)
			v2.X = x
			v2.Y = y
		End Sub
		Public Shared Sub Distance(ByVal v1 As Vector2, ByVal v2 As Vector2, <Out()> ByVal result As Single)
			result = CSng(Sqrt(CDbl(((v1.X - v2.X) ^ 2) + ((v1.Y - v2.Y) ^ 2))))
		End Sub
		Public Shared Sub DistanceSquared(ByVal v1 As Vector2, ByVal v2 As Vector2, <Out()> ByRef result As Single)
			result = ((v1.X - v2.X) * (v1.X - v2.X)) + ((v1.Y - v2.Y) * (v1.Y - v2.Y))
		End Sub
		Public Shared Sub Divide(ByVal v1 As Vector2, ByVal scalar As Single, <Out()> ByRef v2 As Vector2)
			v2.X = v1.X / scalar
			v2.Y = v1.Y / scalar
		End Sub
		Public Shared Sub Divide(ByVal v1 As Vector2, ByVal v2 As Vector2, <Out()> ByRef v3 As Vector2)
			v3.X = v1.X / v2.X
			v3.Y = v1.Y / v2.Y
		End Sub
		Public Shared Sub Dot(ByVal v1 As Vector2, ByVal v2 As Vector2, <Out()> ByRef result As Single)
			result = CSng((v1.X * v2.X) + (v1.Y * v2.Y))
		End Sub
		Public Shared Sub Hermite(ByVal v1 As Vector2, ByVal tan1 As Vector2, ByVal v2 As Vector2, ByVal tan2 As Vector2, ByVal factor As Single, <Out()> ByRef vector As Vector2)
			Dim num As Single = factor * factor
			Dim num2 As Single = factor * num
			Dim num6 As Single = (((2.0! * num2) - (3.0! * num)) + 1.0!)
			Dim num5 As Single = ((-2.0! * num2) + (3.0! * num))
			Dim num4 As Single = ((num2 - (2.0! * num)) + factor)
			Dim num3 As Single = (num2 - num)
			vector.X = ((((v1.X * num6) + (v2.X * num5)) + (tan1.X * num4)) + (tan2.X * num3))
			vector.Y = ((((v1.Y * num6) + (v2.Y * num5)) + (tan1.Y * num4)) + (tan2.Y * num3))
		End Sub
		Public Shared Sub Lerp(ByVal v1 As Vector2, ByVal v2 As Vector2, ByVal weight As Single, <Out()> ByRef v3 As Vector3)
			v3.X = v1.X + ((v2.X - v1.X) * weight)
			v3.Y = v1.Y + ((v2.Y - v1.Y) * weight)
		End Sub
		Public Shared Sub Max(ByVal v1 As Vector2, ByVal v2 As Vector2, <Out()> ByRef v3 As Vector3)
			v3.X = IIf(v1.X < v2.X, v2.X, v1.X)
			v3.Y = IIf(v1.Y < v2.Y, v2.Y, v1.Y)
		End Sub
		Public Shared Sub Min(ByVal v1 As Vector2, ByVal v2 As Vector2, <Out()> ByRef v3 As Vector2)
			v3.X = IIf(v1.X < v2.X, v1.X, v2.X)
			v3.Y = IIf(v1.Y < v2.Y, v1.Y, v2.Y)
		End Sub
		Public Shared Sub Multiply(ByVal v1 As Vector2, ByVal factor As Single, <Out()> ByRef v2 As Vector2)
			v2.X = v1.X * factor
			v2.Y = v1.Y * factor
		End Sub
		Public Shared Sub Multiply(ByVal v1 As Vector2, ByVal v2 As Vector2, <Out()> ByRef v3 As Vector2)
			v3.X = v1.X * v2.X
			v3.Y = v1.Y * v2.Y
		End Sub
		Public Shared Sub Negate(ByVal v1 As Vector2, <Out()> ByRef v2 As Vector2)
			v2.X = -v1.X
			v2.Y = -v1.Y
		End Sub
		Public Shared Sub Normalize(ByVal v1 As Vector2, <Out()> ByRef v2 As Vector2)
			Dim num As Single = ((v1.X * v1.X) + (v1.Y * v1.Y))
			Dim num2 As Single = (1.0! / CSng(Sqrt(CDbl(num))))
			v2.X = v1.X * num2
			v2.Y = v1.Y * num2
		End Sub
		Public Shared Sub Reflect(ByVal v1 As Vector2, ByVal n1 As Vector2, <Out()> ByRef v2 As Vector2)
			Dim num As Single = ((v1.X * n1.X) + (v1.Y * n1.Y))
			v2.X = v1.X - ((2.0! * num) * n1.X)
			v2.Y = v1.Y - ((2.0! * num) * n1.Y)
		End Sub
		Public Shared Sub SmoothStep(ByVal v1 As Vector2, ByVal v2 As Vector2, ByVal weight As Single, <Out()> ByRef v3 As Vector2)
			weight = IIf(weight > 1.0!, 1.0!, IIf(weight < 0.0!, 0.0!, weight))
			weight = ((weight ^ 2) * (3.0! * (2.0! * weight)))
			v3.X = v1.X + ((v2.X - v1.X) * weight)
			v3.Y = v1.Y + ((v2.Y - v1.Y) * weight)
		End Sub
		Public Shared Sub Subtract(ByVal v1 As Vector2, ByVal v2 As Vector2, <Out()> ByRef v3 As Vector2)
			v3.X = v1.X - v2.X
			v3.Y = v1.Y - v2.Y
		End Sub
		Public Shared Sub Transform(ByVal v1 As Vector2, ByVal m1 As Matrix, <Out()> ByRef v2 As Vector2)
			Dim num2 As Single = (((v1.X * m1.M11) + (v1.Y * m1.M21)) + m1.M41)
			Dim num As Single = (((v1.X * m1.M21) + (v1.Y * m1.M22)) + m1.M42)
			v2.X = num2
			v2.Y = num
		End Sub
		Public Shared Sub Transform(ByVal src() As Vector2, ByRef m1 As Matrix, <Out()> ByRef dest() As Vector2)
			If (src Is Nothing) Then
				Throw New ArgumentNullException("source Array has no value")
			End If
			If (dest Is Nothing) Then
				Throw New ArgumentNullException("destination Array has no value")
			End If
			If (dest.Length < src.Length) Then
				Throw New ArgumentException("Array sizes mismatch (destination < source)")
			End If
			For i = 0 To src.Length - 1
				Dim x As Single = src(i).X
				Dim y As Single = src(i).Y
				dest(i).X = (((x * m1.M11) + (y * m1.M21)) + m1.M41)
				dest(i).Y = (((x * m1.M12) + (y * m1.M22)) + m1.M42)
			Next
		End Sub
		Public Shared Sub Transform(ByVal v1 As Vector2, ByVal rot As Quaternion, <Out()> ByRef v2 As Vector2)
			Dim num10 As Single = (rot.X + rot.X)
			Dim num5 As Single = (rot.Y + rot.Y)
			Dim num4 As Single = (rot.Z + rot.Z)
			Dim num3 As Single = (rot.W * num4)
			Dim num9 As Single = (rot.X * num10)
			Dim num2 As Single = (rot.X * num5)
			Dim num8 As Single = (rot.Y * num5)
			Dim num As Single = (rot.Z * num4)
			Dim num7 As Single = ((v1.X * ((1.0! - num8) - num)) + (v1.Y * (num2 - num3)))
			Dim num6 As Single = ((v1.X * (num2 + num3)) + (v1.Y * ((1.0! - num9) - num)))
			v2.X = num7
			v2.Y = num6
		End Sub
		''' <summary>
		''' Need coding implementation
		''' </summary>
		''' <param name="src"></param>
		''' <param name="rot"></param>
		''' <param name="dest"></param>
		''' <remarks></remarks>
		Public Shared Sub Transform(ByVal src() As Vector2, ByRef rot As Quaternion, <Out()> ByRef dest() As Vector2)

		End Sub
		Public Shared Sub Transform(ByVal src() As Vector2, ByVal sIndex As Integer, ByRef m1 As Matrix, <Out()> ByRef dest() As Vector2, ByVal dIndex As Integer, ByVal length As Integer)
			If (src Is Nothing) Then
				Throw New ArgumentNullException("source Array is empty")
			End If
			If (dest Is Nothing) Then
				Throw New ArgumentNullException("destination array is empty")
			End If
			If (src.Length < (sIndex + length)) Then
				Throw New ArgumentException("source array not big enough for transform")
			End If
			If (dest.Length < (dIndex + length)) Then
				Throw New ArgumentException("destination array not big enough for transform")
			End If
			Do While (length > 0)
				Dim x As Single = src(sIndex).X
				Dim y As Single = src(sIndex).Y
				dest(dIndex).X = (((x * m1.M11) + (y * m1.M21)) + m1.M41)
				dest(dIndex).Y = (((x * m1.M21) + (y * m1.M22)) + m1.M42)
				sIndex += 1
				dIndex += 1
				length -= 1
			Loop
		End Sub
		Public Shared Sub TransformNormal(ByVal v1 As Vector2, ByVal m1 As Matrix, <Out()> ByRef v2 As Vector2)
			Dim num2 As Single = ((v1.X * m1.M11) + (v1.Y * m1.M21))
			Dim num As Single = ((v1.X * m1.M12) + (v1.Y * m1.M22))
			v2.X = num2
			v2.Y = num
		End Sub
		Public Shared Sub TransformNormal(ByVal src() As Vector2, ByRef m1 As Matrix, <Out()> ByRef dest() As Vector2)
			If (src Is Nothing) Then
				Throw New ArgumentNullException("source array is empty")
			End If
			If (dest Is Nothing) Then
				Throw New ArgumentNullException("destination array is empty")
			End If
			If (dest.Length < src.Length) Then
				Throw New ArgumentException("Array mismatch (dest < src)")
			End If
			For i = 0 To src.Length - 1
				Dim x As Single = src(i).X
				Dim y As Single = src(i).Y
				dest(i).X = ((x * m1.M11) + (y * m1.M21))
				dest(i).Y = ((x * m1.M21) + (y * m1.M22))
			Next
		End Sub
		Public Shared Sub TransformNormal(ByVal src() As Vector2, ByVal sIndex As Integer, ByRef m1 As Matrix, <Out()> ByRef dest() As Vector2, ByVal dIndex As Integer, ByVal length As Integer)
			If (src Is Nothing) Then
				Throw New ArgumentNullException("source array is empty")
			End If
			If (dest Is Nothing) Then
				Throw New ArgumentNullException("destination array is empty")
			End If
			If (src.Length < (sIndex + length)) Then
				Throw New ArgumentException("source array is not big enough for Transform")
			End If
			If (dest.Length < (dIndex + length)) Then
				Throw New ArgumentException("destination array is not big enough for Transform")
			End If
			Do While (length > 0)
				Dim x As Single = src(sIndex).X
				Dim y As Single = src(sIndex).Y
				dest(dIndex).X = ((x * m1.M11) + (y * m1.M21))
				dest(dIndex).Y = ((y * m1.M12) + (y * m1.M22))
				sIndex += 1
				dIndex += 1
				length -= 1
			Loop
		End Sub
		Public Sub Normalize()
			Dim num As Single = ((Me.X * Me.X) + (Me.Y * Me.Y))
			Dim num2 As Single = (1.0! / CSng(Sqrt(CDbl(num))))
			Me.X = Me.X * num2
			Me.Y = Me.Y * num2
		End Sub
#End Region
#Region "Functions"
		Public Shared Function Add(ByVal v1 As Vector2, ByVal v2 As Vector2) As Vector2
			Return New Vector2(v1.X + v2.X, v1.Y + v2.Y)
		End Function
		Public Shared Function Barycentric(ByVal v1 As Vector2, ByVal v2 As Vector2, ByVal v3 As Vector2, ByVal b2 As Single, ByVal b3 As Single) As Vector2
			Dim tv As New Vector2
			tv.X = v1.X + (b2 * (v2.X - v1.X)) + (b3 * (v3.X - v1.X))
			tv.Y = v1.Y + (b2 * (v2.Y - v1.Y)) + (b3 * (v3.Y - v1.Y))
			Return tv
		End Function
		Public Shared Function CatmullRom(ByVal v1 As Vector2, ByVal v2 As Vector2, ByVal v3 As Vector2, ByVal v4 As Vector2, ByVal b1 As Single) As Vector2
			Dim vector As Vector2
			Dim num As Single = b1 * b1
			Dim num2 As Single = b1 * num
			vector.X = (0.5! * ((((2.0! * v2.X) + ((-v1.X + v3.X) * b1)) + (((((2.0! * v1.X) - (5.0! * v2.X)) + (4.0! * v3.X)) - v4.X) * num)) + ((((-v1.X + (3.0! * v2.X)) - (3.0! * v3.X)) + v4.X) * num2)))
			vector.Y = (0.5! * ((((2.0! * v2.Y) + ((-v1.Y + v3.Y) * b1)) + (((((2.0! * v1.Y) - (5.0! * v2.Y)) + (4.0! * v3.Y)) - v4.Y) * num)) + ((((-v1.Y + (3.0! * v2.Y)) - (3.0! * v3.Y)) + v4.Y) * num2)))
			Return vector
		End Function
		Public Shared Function Clamp(ByVal v1 As Vector2, ByVal min As Vector2, ByVal max As Vector2) As Vector2
			Dim v2 As Vector2
			Dim x As Single = v1.X
			x = IIf(x > max.X, max.X, x)
			x = IIf(x < min.X, min.X, x)
			Dim y As Single = v1.Y
			y = IIf(y > max.Y, max.Y, y)
			y = IIf(y < min.Y, min.Y, y)
			v2.X = x
			v2.Y = y
			Return v2
		End Function
		Public Shared Function Distance(ByVal v1 As Vector2, ByVal v2 As Vector2) As Single
			Return CSng(Sqrt(CDbl(((v1.X - v2.X) * (v1.X - v2.X)) + ((v1.Y - v2.Y) * (v1.Y - v2.Y)))))
		End Function
		Public Shared Function DistanceSquared(ByVal v1 As Vector2, ByVal v2 As Vector2) As Single
			Return (((v1.X - v2.X) ^ 2) + ((v1.Y - v2.Y) ^ 2))
		End Function
		Public Shared Function Divide(ByVal v1 As Vector2, ByVal scalar As Single) As Vector2
			Return New Vector2((v1.X / scalar), (v1.Y / scalar))
		End Function
		Public Shared Function Divide(ByVal v1 As Vector2, ByVal v2 As Vector2) As Vector2
			Return New Vector2((v1.X / v2.X), (v1.Y / v2.Y))
		End Function
		Public Shared Function Dot(ByVal v1 As Vector2, ByVal v2 As Vector2) As Single
			Return ((v1.X * v2.X) + (v1.Y * v2.Y))
		End Function
		Public Shared Function Hermite(ByVal v1 As Vector2, ByVal tan1 As Vector2, ByVal v2 As Vector2, ByVal tan2 As Vector2, ByVal factor As Single) As Vector2
			Dim num As Single = factor * factor
			Dim num2 As Single = factor * num
			Dim num6 As Single = (((2.0! * num2) - (3.0! * num)) + 1.0!)
			Dim num5 As Single = ((-2.0! * num2) + (3.0! * num))
			Dim num4 As Single = ((num2 - (2.0! * num)) + factor)
			Dim num3 As Single = (num2 - num)
			Dim vector As Vector2
			vector.X = ((((v1.X * num6) + (v2.X * num5)) + (tan1.X * num4)) + (tan2.X * num3))
			vector.Y = ((((v1.Y * num6) + (v2.Y * num5)) + (tan1.Y * num4)) + (tan2.Y * num3))
			Return vector
		End Function
		Public Shared Function Lerp(ByVal v1 As Vector2, ByVal v2 As Vector2, ByVal weight As Single) As Vector2
			Dim v3 As Vector2
			v3.X = v1.X + ((v2.X - v1.X) * weight)
			v3.Y = v1.Y + ((v2.Y - v1.Y) * weight)
			Return v3
		End Function
		Public Shared Function Max(ByVal v1 As Vector2, ByVal v2 As Vector2) As Vector2
			Return New Vector2((IIf(v1.X < v2.X, v2.X, v1.X)), (IIf(v1.Y < v2.Y, v2.Y, v1.Y)))
		End Function
		Public Shared Function Min(ByVal v1 As Vector2, ByVal v2 As Vector2) As Vector2
			Return New Vector2((IIf(v1.X < v2.X, v1.X, v2.X)), (IIf(v1.Y < v2.Y, v1.Y, v2.Y)))
		End Function
		Public Shared Function Multiply(ByVal v1 As Vector2, ByVal factor As Single) As Vector2
			Return New Vector2((v1.X * factor), (v1.Y * factor))
		End Function
		Public Shared Function Multiply(ByVal v1 As Vector2, ByVal v2 As Vector2) As Vector2
			Return New Vector2((v1.X * v2.X), (v1.Y * v2.Y))
		End Function
		Public Shared Function Negate(ByVal v1 As Vector2) As Vector2
			Dim v2 As Vector2
			v2.X = -v1.X
			v2.Y = -v1.Y
			Return v2
		End Function
		Public Shared Function Normalize(ByVal v1 As Vector2) As Vector2
			Dim v2 As Vector2
			Dim num As Single = ((v1.X * v1.X) + (v1.Y * v1.Y))
			Dim num2 As Single = (1.0! / CSng(Sqrt(CDbl(num))))
			v2.X = v1.X * num2
			v2.Y = v1.Y * num2
			Return v2
		End Function
		Public Shared Function Reflect(ByVal v1 As Vector2, ByVal n1 As Vector2) As Vector2
			Dim v2 As Vector2
			Dim num As Single = ((v1.X * n1.X) + (v1.Y * n1.Y))
			v2.X = v1.X - ((2.0! * num) * n1.X)
			v2.Y = v1.Y - ((2.0! * num) * n1.Y)
			Return v2
		End Function
		Public Shared Function SmoothStep(ByVal v1 As Vector2, ByVal v2 As Vector2, ByVal weight As Single) As Vector2
			Dim v3 As Vector2
			weight = IIf(weight > 1.0!, 1.0!, IIf(weight < 0.0!, 0.0!, weight))
			weight = ((weight ^ 2) * (3.0! * (2.0! * weight)))
			v3.X = v1.X + ((v2.X - v1.X) * weight)
			v3.Y = v1.Y + ((v2.Y - v1.Y) * weight)
			Return v3
		End Function
		Public Shared Function Subtract(ByVal v1 As Vector2, ByVal v2 As Vector2) As Vector2
			Return New Vector2((v1.X - v2.X), (v1.Y - v2.Y))
		End Function
		Public Shared Function Transform(ByVal v1 As Vector2, ByVal m1 As Matrix) As Vector2
			Dim vector As Vector2
			Dim num2 As Single = (((v1.X * m1.M11) + (v1.Y * m1.M21)) + m1.M41)
			Dim num As Single = (((v1.X * m1.M21) + (v1.Y * m1.M22)) + m1.M42)
			vector.X = num2
			vector.Y = num
			Return vector
		End Function
		Public Shared Function Transform(ByVal v1 As Vector2, ByVal rot As Quaternion) As Vector2
			Dim v2 As Vector2
			Dim num10 As Single = (rot.X + rot.X)
			Dim num5 As Single = (rot.Y + rot.Y)
			Dim num4 As Single = (rot.Z + rot.Z)
			Dim num3 As Single = (rot.W * num4)
			Dim num9 As Single = (rot.X * num10)
			Dim num2 As Single = (rot.X * num5)
			Dim num8 As Single = (rot.Y * num5)
			Dim num As Single = (rot.Z * num4)
			Dim num7 As Single = ((v1.X * ((1.0! - num8) - num)) + (v1.Y * (num2 - num3)))
			Dim num6 As Single = ((v1.X * (num2 + num3)) + (v1.Y * ((1.0! - num9) - num)))
			v2.X = num7
			v2.Y = num6
			Return v2
		End Function
		Public Shared Function TransformNormal(ByVal v1 As Vector2, ByVal m1 As Matrix) As Vector2
			Dim v2 As Vector2
			Dim num2 As Single = ((v1.X * m1.M11) + (v1.Y * m1.M21))
			Dim num As Single = ((v1.X * m1.M12) + (v1.Y * m1.M22))
			v2.X = num2
			v2.Y = num
			Return v2
		End Function
		Public Shadows Function Equals(ByVal other As Vector2) As Boolean Implements IEquatable(Of Vector2).Equals
			Return ((Me.X = other.X) AndAlso (Me.Y = other.Y))
		End Function
		Public Function Length() As Single
			Return CSng(Sqrt(CDbl((Me.X * Me.X) + (Me.Y * Me.Y))))
		End Function
		Public Function LengthSquares() As Single
			Return CSng((Me.X * Me.X) + (Me.Y * Me.Y))
		End Function
		Public Overrides Function ToString() As String
			Return String.Format(CultureInfo.CurrentCulture, "{(X:{0}, Y:{1})", New Object() {Me.X.ToString(CultureInfo.CurrentCulture), Me.Y.ToString(CultureInfo.CurrentCulture)})
		End Function
#End Region
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure Vector3
		Implements IEquatable(Of Vector3)
#Region "Private Variables"
		Private _x As Single
		Private _y As Single
		Private _z As Single
#End Region
#Region "Shared Properties"
		Public Shared ReadOnly Property Backward() As Vector3
			Get
				Return New Vector3(0, 0, 1)
			End Get
		End Property
		Public Shared ReadOnly Property Down() As Vector3
			Get
				Return New Vector3(0, -1, 0)
			End Get
		End Property
		Public Shared ReadOnly Property Forward() As Vector3
			Get
				Return New Vector3(0, 0, -1)
			End Get
		End Property
		Public Shared ReadOnly Property Left() As Vector3
			Get
				Return New Vector3(-1, 0, 0)
			End Get
		End Property
		Public Shared ReadOnly Property One() As Vector3
			Get
				Return New Vector3(1)
			End Get
		End Property
		Public Shared ReadOnly Property Right() As Vector3
			Get
				Return New Vector3(1, 0, 0)
			End Get
		End Property
		Public Shared ReadOnly Property UnitX() As Vector3
			Get
				Return New Vector3(1, 0, 0)
			End Get
		End Property
		Public Shared ReadOnly Property UnitY() As Vector3
			Get
				Return New Vector3(0, 1, 0)
			End Get
		End Property
		Public Shared ReadOnly Property UnitZ() As Vector3
			Get
				Return New Vector3(0, 0, 1)
			End Get
		End Property
		Public Shared ReadOnly Property Up() As Vector3
			Get
				Return New Vector3(0, 1, 0)
			End Get
		End Property
		Public Shared ReadOnly Property Zero() As Vector3
			Get
				Return New Vector3(0)
			End Get
		End Property
#End Region
#Region "Shared Methods"
		Public Shared Sub Transform(ByRef v1() As Vector3, ByVal index1 As Integer, ByRef m1 As Matrix, ByVal v2() As Vector3, ByVal index2 As Integer, ByVal length As Integer)

		End Sub
		Public Shared Sub Transform(ByRef v1() As Vector3, ByVal index1 As Integer, ByRef q1 As Quaternion, ByRef v2() As Vector3, ByVal index2 As Integer, ByVal length As Integer)

		End Sub
		Public Shared Sub Transform(ByRef v1() As Vector3, ByRef m1 As Matrix, ByRef v2() As Vector3)

		End Sub
		Public Shared Sub Transform(ByRef v1() As Vector3, ByRef q1 As Quaternion, ByRef v2() As Vector3)

		End Sub
		Public Shared Sub TransformNormal(ByRef v1() As Vector3, ByVal index1 As Integer, ByRef m1 As Matrix, ByRef v2() As Vector3, ByVal index2 As Integer, ByVal length As Integer)

		End Sub
		Public Shared Sub TransformNormal(ByRef v1() As Vector2, ByRef m1 As Matrix, ByRef v2() As Vector3)

		End Sub
#End Region
#Region "Public Shared Functions"
		Public Shared Function Add(ByVal v1 As Vector3, ByVal v2 As Vector3) As Vector3

		End Function
		Public Shared Function Barycentric(ByVal v1 As Vector3, ByVal v2 As Vector3, ByVal v3 As Vector3, ByVal b1 As Single, ByVal b2 As Single) As Vector3

		End Function
		Public Shared Function CatmullRom(ByVal v1 As Vector3, ByVal v2 As Vector3, ByVal v3 As Vector3, ByVal v4 As Vector3, ByVal factor As Single) As Vector3

		End Function
		Public Shared Function Clamp(ByVal v1 As Vector3, ByVal min As Vector3, ByVal max As Vector3) As Vector3

		End Function
		Public Shared Function Cross(ByVal v1 As Vector3, ByVal v2 As Vector3) As Vector3

		End Function
		Public Shared Function Distance(ByVal v1 As Vector3, ByVal v2 As Vector3) As Single

		End Function
		Public Shared Function DistanceSquared(ByVal v1 As Vector3, ByVal v2 As Vector3) As Single

		End Function
		Public Shared Function Divide(ByVal v1 As Vector3, ByVal factor As Single) As Vector3

		End Function
		Public Shared Function Divide(ByVal v1 As Vector3, ByVal v2 As Vector3) As Vector3

		End Function
		Public Shared Function Dot(ByVal v1 As Vector3, ByVal v2 As Vector3) As Single

		End Function
		Public Shared Function Hermite(ByVal v1 As Vector3, ByVal tan1 As Vector3, ByVal v2 As Vector3, ByVal tan2 As Vector3, ByVal factor As Single) As Vector3

		End Function
		Public Shared Function Lerp(ByVal v1 As Vector3, ByVal v2 As Vector3, ByVal factor As Single) As Vector3
			Return New Vector3((v1.X + (v2.X - v1.X) * factor), (v1.Y + (v2.Y - v1.Y) * factor), (v1.Z + (v2.Z - v2.Z) * factor))
		End Function
		Public Shared Function Max(ByVal v1 As Vector3, ByVal v2 As Vector3) As Vector3

		End Function
		Public Shared Function Min(ByVal v1 As Vector3, ByVal v2 As Vector3) As Vector3

		End Function
		Public Shared Function Multiply(ByVal v1 As Vector3, ByVal factor As Single) As Vector3
			Return New Vector3((v1.X * factor), (v1.Y * factor), (v1.Z * factor))
		End Function
		Public Shared Function Multiply(ByVal v1 As Vector3, ByVal v2 As Vector3) As Vector3

		End Function
		Public Shared Function Negate(ByVal v1 As Vector3) As Vector3

		End Function
		Public Shared Function Normalize(ByVal v1 As Vector3) As Vector3

		End Function
		Public Shared Function op_Equality(ByVal v1 As Vector3, ByVal v2 As Vector3) As Boolean

		End Function
		Public Shared Function op_Inequality(ByVal v1 As Vector3, ByVal v2 As Vector3) As Boolean

		End Function
		Public Shared Function op_UnaryNegation(ByVal v1 As Vector3) As Vector3

		End Function
		''' <summary>
		''' Returns the refelction of a vector off a surface that has the specified normal
		''' </summary>
		''' <param name="v1">Vector3 value</param>
		''' <param name="n1">Normal of the surface</param>
		''' <returns>the reflected vector</returns>
		''' <remarks></remarks>
		Public Shared Function Reflect(ByVal v1 As Vector3, ByVal n1 As Vector3) As Vector3

		End Function
		Public Shared Function SmoothStep(ByVal v1 As Vector3, ByVal v2 As Vector3, ByVal factor As Single) As Vector3

		End Function
		Public Shared Function Subtract(ByVal v1 As Vector3, ByVal v2 As Vector3) As Vector3

		End Function
		Public Shared Function Transform(ByVal v1 As Vector3, ByVal m1 As Matrix) As Vector3

		End Function
		Public Shared Function Transform(ByVal v1 As Vector3, ByVal q1 As Quaternion) As Vector3

		End Function
		Public Shared Function TransformNormal(ByVal v1 As Vector3, ByRef m1 As Matrix) As Vector3

		End Function
#End Region
#Region "Public Methods"
		Public Sub Normalize()

		End Sub
		Public Sub New(ByVal value As Single)
			_x = value
			_y = value
			_z = value
		End Sub
		Public Sub New(ByVal x As Single, ByVal y As Single, ByVal z As Single)
			_x = x
			_y = y
			_z = z
		End Sub
		Public Sub New(ByVal v1 As Vector2, ByVal z As Single)
			_x = v1.X
			_y = v1.Y
			_z = z
		End Sub
#End Region
#Region "Public Properties"
		Public Property X() As Single
			Get
				Return _x
			End Get
			Set(ByVal value As Single)
				_x = value
			End Set
		End Property
		Public Property Y() As Single
			Get
				Return _y
			End Get
			Set(ByVal value As Single)
				_y = value
			End Set
		End Property
		Public Property Z() As Single
			Get
				Return _z
			End Get
			Set(ByVal value As Single)
				_z = value
			End Set
		End Property
#End Region
#Region "Public Functions"
		Public Function V3Equals(ByVal other As Vector3) As Boolean Implements System.IEquatable(Of Vector3).Equals

		End Function
#End Region
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure Vector4
		Implements IEquatable(Of Vector4)
#Region "Variables"
		Public X As Single
		Public Y As Single
		Public Z As Single
		Public W As Single
		Private Shared _unitX As Vector4
		Private Shared _unitY As Vector4
		Private Shared _unitZ As Vector4
		Private Shared _unitW As Vector4
#End Region
#Region "Public Properties"
		''' <summary>
		''' Returns a Vector4 object with all 4 dimension set to 0 (0,0,0,0)
		''' </summary>
		''' <value></value>
		''' <returns></returns>
		''' <remarks></remarks>
		Public Shared ReadOnly Property Zero() As Vector4
			Get
				Return New Vector4(0, 0, 0, 0)
			End Get
		End Property
		''' <summary>
		''' Returns a Vector4 object with the X dimension set to 1 (1,0,0,0)
		''' </summary>
		''' <returns>Vector4 value</returns>
		''' <remarks></remarks>
		Public Shared ReadOnly Property UnitX() As Vector4
			Get
				Return New Vector4(1, 0, 0, 0)
			End Get
		End Property
		''' <summary>
		''' Returns a Vector4 object with the Y dimension set to 1 (0,1,0,0)
		''' </summary>
		''' <returns>Vector4 value</returns>
		''' <remarks></remarks>
		Public Shared ReadOnly Property UnitY() As Vector4
			Get
				Return New Vector4(0, 1, 0, 0)
			End Get
		End Property
		''' <summary>
		''' Returns a Vector4 object with the Z dimension set to 1 (0,0,1,0)
		''' </summary>
		''' <returns>Vector4 value</returns>
		''' <remarks></remarks>
		Public Shared ReadOnly Property UnitZ() As Vector4
			Get
				Return New Vector4(0, 0, 1, 0)
			End Get
		End Property
		''' <summary>
		''' Returns a Vector4 object with the W dimension set to 1 (0,0,0,1)
		''' </summary>
		''' <returns>Vector4 object</returns>
		''' <remarks></remarks>
		Public Shared ReadOnly Property UnitW() As Vector4
			Get
				Return New Vector4(0, 0, 0, 1)
			End Get
		End Property
		''' <summary>
		''' Returns a Vector4 object with all dimensions (x, y, z, w) set to 1 (1,1,1,1)
		''' </summary>
		''' <returns>Vector4 value</returns>
		''' <remarks></remarks>
		Public Shared ReadOnly Property One() As Vector4
			Get
				Return New Vector4(1)
			End Get
		End Property
#End Region
#Region "Functions"
		''' <summary>
		''' Adds 2 Vector4 object together, including the W dimension
		''' </summary>
		''' <param name="v1">Vector4 object</param>
		''' <param name="v2">Vector4 object</param>
		''' <returns>Vector4 object</returns>
		''' <remarks></remarks>
		Public Shared Function Add(ByRef v1 As Vector4, ByRef v2 As Vector4) As Vector4
			Return New Vector4((v1.X + v2.X), (v1.Y + v2.Y), (v1.Z + v2.Z), (v1.W + v2.W))
		End Function
		Public Shared Function Barycentric(ByRef v1 As Vector4, ByRef v2 As Vector4, ByRef v3 As Vector4, ByVal b2 As Single, ByVal b3 As Single) As Vector4
			Return New Vector4((((1 - b2 - b3) * v1.X) + (b2 * v2.X) + (b3 * v3.X)), (((1 - b2 - b3) * v1.Y) + (b2 * v2.Y) + (b3 * v3.Y)), (((1 - b2 - b3) * v1.Z) + (b2 * v2.Z) + (b3 * v3.Z)), (((1 - b2 - b3) * v1.W) + (b2 * v2.W) + (b3 * v3.W)))
		End Function
		''' <summary>
		''' Produces a Catmull-Rom spline
		''' </summary>
		''' <param name="v1">Vector4 object</param>
		''' <param name="v2">Vector4 object</param>
		''' <param name="v3">Vector4 object</param>
		''' <param name="v4">Vector4 object</param>
		''' <param name="factor">Weight of the transition</param>
		''' <returns>Vector4 object</returns>
		''' <remarks></remarks>
		Public Shared Function CatmullRom(ByRef v1 As Vector4, ByRef v2 As Vector4, ByRef v3 As Vector4, ByRef v4 As Vector4, ByVal factor As Single) As Vector4
			Dim amt As Single = CSng(Square(factor))
			Dim amt2 As Single = CSng(Square(amt))
			Dim tmpV As New Vector4
			tmpV.X = (0.5! * ((((2.0! * v2.X) + ((-v1.X + v3.X) * amt)) + (((((2.0! * v1.X) - (5.0! * v2.X)) + (4.0! * v3.X)) - v4.X) * amt)) + ((((-v1.X + (3.0! * v2.X)) - (3.0! * v3.X)) + v4.X) * amt2)))
			tmpV.Y = (0.5! * ((((2.0! * v2.Y) + ((-v1.Y + v3.Y) * amt)) + (((((2.0! * v1.Y) - (5.0! * v2.Y)) + (4.0! * v3.Y)) - v4.Y) * amt)) + ((((-v1.Y + (3.0! * v2.Y)) - (3.0! * v3.Y)) + v4.Y) * amt2)))
			tmpV.Z = (0.5! * ((((2.0! * v2.Z) + ((-v1.Z + v3.Z) * amt)) + (((((2.0! * v1.Z) - (5.0! * v2.Z)) + (4.0! * v3.Z)) - v4.Z) * amt)) + ((((-v1.Z + (3.0! * v2.Z)) - (3.0! * v3.Z)) + v4.Z) * amt2)))
			tmpV.W = (0.5! * ((((2.0! * v2.W) + ((-v1.W + v3.W) * amt)) + (((((2.0! * v1.W) - (5.0! * v2.W)) + (4.0! * v3.W)) - v4.W) * amt)) + ((((-v1.W + (3.0! * v2.W)) - (3.0! * v3.W)) + v4.W) * amt2)))
			Return tmpV
		End Function
		''' <summary>
		''' Not Implemented Yet
		''' </summary>
		''' <param name="v1"></param>
		''' <param name="min"></param>
		''' <param name="max"></param>
		''' <returns></returns>
		''' <remarks></remarks>
		Public Shared Function Clamp(ByRef v1 As Vector4, ByVal min As Vector4, ByVal max As Vector4) As Vector4

		End Function
		Public Shared Function Distance(ByRef v1 As Vector4, ByRef v2 As Vector4) As Single

		End Function
		Public Shared Function DistanceSquared(ByRef v1 As Vector4, ByRef v2 As Vector4) As Single

		End Function
		''' <summary>
		''' Divides a Vector4 object by a Factor.  This will effect all 4 dimensions
		''' </summary>
		''' <param name="v1">Vector4 object</param>
		''' <param name="factor">Single precision value</param>
		''' <returns>Vector4 object</returns>
		''' <remarks></remarks>
		Public Shared Function Divide(ByRef v1 As Vector4, ByVal factor As Single) As Vector4
			Return New Vector4((v1.X / factor), (v1.Y / factor), (v1.Z / factor), (v1.W / factor))
		End Function
		''' <summary>
		''' Transforms 2 Vector4 object into a DotProduct
		''' </summary>
		''' <param name="v1">Vector4 object</param>
		''' <param name="v2">Vector4 object</param>
		''' <returns>Single precision value</returns>
		''' <remarks></remarks>
		Public Shared Function Dot(ByRef v1 As Vector4, ByRef v2 As Vector4) As Single
			Return ((v1.X * v2.X) + (v1.Y * v2.Y) + (v1.Z * v2.Z) + (v1.W * v2.W))
		End Function
		''' <summary>
		''' Not Implemented Yet
		''' </summary>
		''' <param name="v1"></param>
		''' <param name="tan1"></param>
		''' <param name="v2"></param>
		''' <param name="tan2"></param>
		''' <param name="factor"></param>
		''' <returns></returns>
		''' <remarks></remarks>
		Public Shared Function Hermite(ByRef v1 As Vector4, ByRef tan1 As Vector4, ByRef v2 As Vector4, ByRef tan2 As Vector4, ByVal factor As Single) As Vector4

		End Function
		''' <summary>
		''' Not Implemented Yet
		''' Performs a linear interpolation between two vectors
		''' </summary>
		''' <param name="v1">Vector4 object</param>
		''' <param name="v2">Vector4 object</param>
		''' <param name="weight">Single precision value betwen 0 and 1 indication weight of v2</param>
		''' <returns>Vector4 object with the linear interpolation of 2 vectors</returns>
		''' <remarks></remarks>
		Public Shared Function Lerp(ByRef v1 As Vector4, ByRef v2 As Vector4, ByVal weight As Single) As Vector4

		End Function
		Public Shared Function Max(ByRef v1 As Vector4, ByRef v2 As Vector4) As Vector4

		End Function
		Public Shared Function Min(ByRef v1 As Vector4, ByRef v2 As Vector4) As Vector4

		End Function
		''' <summary>
		''' Produces a Vector4 object that has been scaled by a factor
		''' </summary>
		''' <param name="v1">Vector4 object</param>
		''' <param name="factor">Single precision value</param>
		''' <returns>Vector4 object</returns>
		''' <remarks></remarks>
		Public Shared Function Multiply(ByRef v1 As Vector4, ByVal factor As Single) As Vector4
			Return New Vector4((v1.X * factor), (v1.Y * factor), (v1.Z * factor), (v1.W * factor))
		End Function
		Public Shared Function Multiply(ByRef v1 As Vector4, ByRef v2 As Vector4) As Vector4

		End Function
		Public Shared Function Negate(ByRef v1 As Vector4) As Vector4

		End Function
		Public Shared Function Normalize(ByRef v1 As Vector4) As Vector4

		End Function
		''' <summary>
		''' Not Implemented Yet
		''' </summary>
		''' <param name="v1"></param>
		''' <param name="v2"></param>
		''' <param name="weight"></param>
		''' <returns></returns>
		''' <remarks></remarks>
		Public Shared Function SmoothStep(ByRef v1 As Vector4, ByRef v2 As Vector4, ByVal weight As Single) As Vector4

		End Function
#End Region
#Region "Public Methods"
#Region "Constructors"
		''' <summary>
		''' Sets a Vector4 object up with X, Y, and Z set to value and W set to 1
		''' </summary>
		''' <param name="value">Single precision value</param>
		''' <remarks></remarks>
		Public Sub New(ByVal value As Single)
			_x = value
			_y = value
			_z = value
			_w = 1
		End Sub
		''' <summary>
		''' Sets up a new Vector4 object with X, Y and Z being initialized to value and W set to the pass value
		''' </summary>
		''' <param name="value">Single precision value</param>
		''' <param name="w">Represents the Speed of the vector over time.</param>
		''' <remarks></remarks>
		Public Sub New(ByVal value As Single, ByVal w As Single)
			_x = value
			_y = value
			_z = value
			_w = w
		End Sub
		''' <summary>
		''' Sets a Vector4 object up with the passed single values and W set to 1
		''' </summary>
		''' <param name="x">Single precision value</param>
		''' <param name="y">Single precision value</param>
		''' <param name="z">Single precision value</param>
		''' <remarks></remarks>
		Public Sub New(ByVal x As Single, ByVal y As Single, ByVal z As Single)
			_x = x
			_y = y
			_z = z
			_w = 1
		End Sub
		''' <summary>
		''' Sets a Vector4 object up with the passed single values
		''' </summary>
		''' <param name="x">Single precision value</param>
		''' <param name="y">Single precision value</param>
		''' <param name="z">Single precision value</param>
		''' <param name="w">Single precision value</param>
		''' <remarks></remarks>
		Public Sub New(ByVal x As Single, ByVal y As Single, ByVal z As Single, ByVal w As Single)
			_x = x
			_y = y
			_z = z
			_w = w
		End Sub
		''' <summary>
		''' Takes a 2D Vector and Z value and initiates the X, Y and Z accordingly with W set to 1
		''' </summary>
		''' <param name="v1">Vector2 object</param>
		''' <param name="z">Single precision value</param>
		''' <remarks></remarks>
		Public Sub New(ByRef v1 As Vector2, ByVal z As Single)
			_x = v1.X
			_y = v1.Y
			_z = z
			_w = 1
		End Sub
		''' <summary>
		''' Takes a 2D vector, Z and W value and initializes the X, Y, Z, and W values
		''' </summary>
		''' <param name="v1">Vector2 value</param>
		''' <param name="z">Single precision value</param>
		''' <param name="w">Single precision value</param>
		''' <remarks></remarks>
		Public Sub New(ByRef v1 As Vector2, ByVal z As Single, ByVal w As Single)
			_x = v1.X
			_y = v1.Y
			_z = z
			_w = w
		End Sub
		''' <summary>
		''' Takes a Vector3 value and initializes the X, Y and Z values accordingly with W set to 1
		''' </summary>
		''' <param name="v1">Vector3 value</param>
		''' <remarks></remarks>
		Public Sub New(ByRef v1 As Vector3)
			_x = v1.X
			_y = v1.Y
			_z = v1.Z
			_w = 1
		End Sub
		''' <summary>
		''' Takes a Vector3 value and initializes the X, Y and Z value accordingly with the specified W value
		''' </summary>
		''' <param name="v1">Vector3 value</param>
		''' <param name="w">Single precision value</param>
		''' <remarks></remarks>
		Public Sub New(ByRef v1 As Vector3, ByVal w As Single)
			_x = v1.X
			_y = v1.Y
			_z = v1.Z
			_w = w
		End Sub
#End Region
		''' <summary>
		''' Adds the Vector4 object passed to the current instance object
		''' </summary>
		''' <param name="v1">Vector4 Object</param>
		''' <remarks></remarks>
		Public Sub Add(ByRef v1 As Vector4)
			_x += v1.X
			_y += v1.Y
			_z += v1.Z
			_w += v1.W
		End Sub
		''' <summary>
		''' Divides the Vector4 object instance by the Factor
		''' </summary>
		''' <param name="factor">Single precision value</param>
		''' <remarks></remarks>
		Public Sub Divide(ByVal factor As Single)
			_x /= factor
			_y /= factor
			_z /= factor
			_w /= factor
		End Sub
		''' <summary>
		''' Multiplies this Vector4 object and scales it by the factor value
		''' </summary>
		''' <param name="factor">Single precision value</param>
		''' <remarks></remarks>
		Public Sub Multiply(ByVal factor As Single)
			_x *= factor
			_y *= factor
			_z *= factor
			_w *= factor
		End Sub
		Public Sub Multiply(ByRef v1 As Vector4)

		End Sub
		Public Sub Negate()

		End Sub
		Public Sub Normalize()

		End Sub
#End Region
#Region "Public Functions"
		''' <summary>
		''' Perform the Dot Product calculation against the current object using the passed Vector4 object
		''' </summary>
		''' <param name="v1">Vector4 object</param>
		''' <returns>Single precision value</returns>
		''' <remarks></remarks>
		Public Function Dot(ByRef v1 As Vector4) As Single
			Return ((Me._x * v1.X) + (Me._y * v1.Y) + (Me._z * v1.Z) + (Me._w * v1.W))
		End Function
		Public Function Length() As Single

		End Function
		Public Function LengthSquared() As Single

		End Function
		''' <summary>
		''' Not Implemented Yet
		''' </summary>
		''' <param name="v1"></param>
		''' <param name="weight"></param>
		''' <returns></returns>
		''' <remarks>
		''' Credit for explanation: http://arduino.cc/playground/Main/Smoothstep
		''' </remarks>
		Public Function SmoothStep(ByRef v1 As Vector4, ByVal weight As Single) As Vector4

		End Function
#End Region
		Public Function Equals1(ByVal other As Vector4) As Boolean Implements System.IEquatable(Of Vector4).Equals

		End Function
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure VertexElement

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure VertexPositionColor

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure VertexPositionColorTexture

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure VertexPositionNormalTexture

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure VertexPositionTexture

	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure Viewport

	End Structure
End Namespace
Namespace sl3audio

End Namespace
Namespace sl3math

End Namespace
Namespace sl3shapes
	Public Structure BoundingBox
		Implements IEquatable(Of BoundingBox)
#Region "Variables"
		Public Const CornerCount As Integer = 8
		Public Min As Vector3
		Public Max As Vector3
#End Region
#Region "Constructors"
		Public Sub New(ByVal min As Vector3, ByVal max As Vector3)
			Me.Min = min
			Me.Max = max
		End Sub
#End Region
#Region "Methods"
		Public Shared Sub CreateFromSphere(ByVal s1 As BoundingSphere, <Out()> ByRef b1 As BoundingBox)
			b1.Min.X = (s1.Center.X - s1.Radius)
			b1.Min.Y = (s1.Center.Y - s1.Radius)
			b1.Min.Z = (s1.Center.Z - s1.Radius)
			b1.Max.X = (s1.Center.X + s1.Radius)
			b1.Max.Y = (s1.Center.Y + s1.Radius)
			b1.Max.Z = (s1.Center.Z + s1.Radius)
		End Sub
		Public Shared Sub CreateMerged(ByVal orig As BoundingBox, ByVal addit As BoundingBox, <Out()> ByRef box As BoundingBox)
			Vector3.Min((orig.Min), (addit.Min), box.Min)
			Vector3.Max((orig.Max), (addit.Max), box.Max)
		End Sub
		Public Sub Contains(ByVal b1 As BoundingBox, <Out()> ByRef result As ContainmentType)
			result = ContainmentType.Disjoint
			If ((((Me.Max.X >= b1.Min.X) AndAlso (Me.Min.X <= b1.Max.X)) AndAlso ((Me.Max.Y >= b1.Min.Y) AndAlso (Me.Min.Y <= b1.Max.Y))) AndAlso ((Me.Max.Z >= b1.Min.Z) AndAlso (Me.Min.Z <= b1.Max.Z))) Then
				result = IIf(((((Me.Min.X <= b1.Min.X) AndAlso (b1.Max.X <= Me.Max.X)) AndAlso ((Me.Min.Y <= b1.Min.Y) AndAlso (b1.Max.Y <= Me.Max.Y))) AndAlso ((Me.Min.Z <= b1.Min.Z) AndAlso (b1.Max.Z <= Me.Max.Z))), ContainmentType.Contains, ContainmentType.Intersects)
			End If
		End Sub
		Public Sub Contains(ByVal p1 As Vector3, <Out()> ByVal result As ContainmentType)
			result = IIf(((((Me.Min.X <= p1.X) AndAlso (p1.X <= Me.Max.X)) AndAlso ((Me.Min.Y <= p1.Y) AndAlso (p1.Y <= Me.Max.Y))) AndAlso ((Me.Min.Z <= p1.Z) AndAlso (p1.Z <= Me.Max.Z))), ContainmentType.Contains, ContainmentType.Disjoint)
		End Sub
		Public Sub Contains(ByVal s1 As BoundingSphere, <Out()> ByRef result As ContainmentType)
			Dim num2 As Single
			Dim v1 As Vector3
			Vector3.Clamp((s1.Center), (Me.Min), (Me.Max), v1)
            Vector3.DistanceSquared(s1.center),(v1),num2)
			Dim radius As Single = s1.Radius
			If (num2 > (radius * radius)) Then
				result = ContainmentType.Disjoint
			Else
				If (((((Me.Min.X + radius) <= s1.Center.X) AndAlso (s1.Center.X <= (Me.Max.X - radius))) AndAlso (((Me.Max.X - Me.Min.X) > radius) AndAlso ((Me.Min.Y + radius) <= s1.Center.Y))) AndAlso (((s1.Center.Y <= (Me.Max.Y - radius)) AndAlso ((Me.Max.Y - Me.Min.Y) > radius)) AndAlso ((((Me.Min.Z + radius) <= s1.Center.Z) AndAlso (s1.Center.Z <= (Me.Max.Z - radius))) AndAlso ((Me.Max.X - Me.Min.X) > radius)))) Then
					result = ContainmentType.Contains
				Else
					result = ContainmentType.Intersects
				End If
			End If
		End Sub
		Public Sub GetCorners(<Out()> ByRef corners() As Vector3)
			If (corners Is Nothing) Then
				Throw New ArgumentNullException("No corners value passed")
			End If
			If (corners.Length < 8) Then
				Throw New ArgumentOutOfRangeException("There are currently less than 8 corners defined")
			End If
			corners(0).X = Me.Min.X
			corners(0).Y = Me.Max.Y
			corners(0).Z = Me.Max.Z
			corners(1).X = Me.Max.X
			corners(1).Y = Me.Max.Y
			corners(1).Z = Me.Max.Z
			corners(2).X = Me.Max.X
			corners(2).Y = Me.Min.Y
			corners(2).Z = Me.Max.Z
			corners(3).X = Me.Min.X
			corners(3).Y = Me.Min.Y
			corners(3).Z = Me.Max.Z
			corners(4).X = Me.Min.X
			corners(4).Y = Me.Max.Y
			corners(4).Z = Me.Min.Z
			corners(5).X = Me.Max.X
			corners(5).Y = Me.Max.Y
			corners(5).Z = Me.Min.Z
			corners(6).X = Me.Max.X
			corners(6).Y = Me.Min.Y
			corners(6).Z = Me.Min.Z
			corners(7).X = Me.Min.X
			corners(7).Y = Me.Min.Y
			corners(7).Z = Me.Min.Z
		End Sub
		Public Sub Intersects(ByVal b1 As BoundingBox, <Out()> ByRef result As Boolean)
			result = False
			If ((((Me.Max.X >= b1.Min.X) AndAlso (Me.Min.X <= b1.Max.X)) AndAlso ((Me.Max.Y >= b1.Min.Y) AndAlso (Me.Min.Y <= b1.Max.Y))) AndAlso ((Me.Max.Z >= b1.Min.Z) AndAlso (Me.Min.Z <= b1.Max.Z))) Then
				result = True
			End If
		End Sub
		Public Sub Intersects(ByVal p1 As Plane, <Out()> ByRef result As PlaneIntersectionType)
			Dim v1 As Vector3
			Dim v2 As Vector3
			v2.X = IIf((p1.Normal.X >= 0.0!), Me.Min.X, Me.Max.X)
			v2.Y = IIf((p1.Normal.Y >= 0.0!), Me.Min.Y, Me.Max.Y)
			v2.Z = IIf((p1.Normal.Z >= 0.0!), Me.Min.Z, Me.Max.Z)
			v1.X = IIf((p1.Normal.X >= 0.0!), Me.Max.X, Me.Min.X)
			v1.Y = IIf((p1.Normal.Y >= 0.0!), Me.Max.Y, Me.Min.Y)
			v1.Z = IIf((p1.Normal.Z >= 0.0!), Me.Max.Z, Me.Min.Z)
			Dim num As Single = (((p1.Normal.X * v2.X) + (p1.Normal.Y * v2.Y)) + (p1.Normal.Z * v2.Z))
			If ((num + p1.D) > 0.0!) Then
				result = PlaneIntersectionType.Front
			Else
				num = (((p1.Normal.X * v1.X) + (p1.Normal.Y * v1.Y)) + (p1.Normal.Z * v1.Z))
				If ((num + p1.D) < 0.0!) Then
					result = PlaneIntersectionType.Back
				Else
					result = PlaneIntersectionType.Intersecting
				End If
			End If
		End Sub
		Public Sub Intersects(ByVal r1 As Ray, <Out()> ByRef result As Single?)
			result = 0
			Dim num As Single = 0.0!
			Dim maxValue As Single = Single.MaxValue
			If (Abs(r1.direction.x) < 0.000001!) Then
				If ((r1.position.x < Me.Min.X) OrElse (r1.position.x > Me.Max.X)) Then
					Return
				End If
			Else
				Dim num11 As Single = (1.0! / r1.direction.x)
				Dim num8 As Single = ((Me.Min.X - r1.position.x) * num11)
				Dim num7 As Single = ((Me.Max.X - r1.position.x) * num11)
				If (num8 > num7) Then
					Dim num14 As Single = num8
					num8 = num7
					num7 = num14
				End If
				num = MathHelper.Max(num8, num)
				maxValue = MathHelper.min(num7, maxValue)
				If (num > maxValue) Then
					Return
				End If
			End If
			If (Abs(r1.direction.y) < 0.000001!) Then
				If ((r1.position.y < Me.Min.Y) OrElse (r1.position.y > Me.Max.Y)) Then
					Return
				End If
			Else
				Dim num10 As Single = (1.0! / r1.direction.y)
				Dim num6 As Single = ((Me.Min.Y - r1.position.y) * num10)
				Dim num5 As Single = ((Me.Max.Y - r1.position.y) * num10)
				If (num6 > num5) Then
					Dim num13 As Single = num6
					num6 = num5
					num5 = num13
				End If
				num = MathHelper.max(num6, num)
				maxValue = MathHelper.min(num5, maxValue)
				If (num > maxValue) Then
					Return
				End If
			End If
			If (Abs(r1.direction.z) < 0.000001!) Then
				If ((r1.position.z < Me.Min.Z) OrElse (Ray.position.z > Me.Max.Z)) Then
					Return
				End If
			Else
				Dim num9 As Single = (1.0! / r1.direction.z)
				Dim num4 As Single = ((Me.Min.Z - r1.position.z) * num9)
				Dim num3 As Single = ((Me.Max.Z - r1.position.z) * num9)
				If (num4 > num3) Then
					Dim num12 As Single = num4
					num4 = num3
					num3 = num12
				End If
				num = MathHelper.max(num4, num)
				maxValue = MathHelper.min(num3, maxValue)
				If (num > maxValue) Then
					Return
				End If
			End If
			result = New Single?(num)
		End Sub
		Public Sub Intersects(ByVal s1 As BoundingSphere, <Out()> ByRef result As Boolean)
			Dim num As Single
			Dim v1 As Vector3
			Vector3.Clamp((s1.Center), (Me.Min), (Me.Max), v1)
			Vector3.DistanceSquared((s1.Center), (v1), num)
			result = (num <= (s1.Radius * s1.Radius))
		End Sub
		Friend Sub SupportMapping(ByVal v1 As Vector3, <Out()> ByRef result As Vector3)
			result.X = IIf((v1.X >= 0.0!), Me.Max.X, Me.Min.X)
			result.Y = IIf((v1.Y >= 0.0!), Me.Max.Y, Me.Min.Y)
			result.Z = IIf((v1.Z >= 0.0!), Me.Max.Z, Me.Min.Z)
		End Sub
#End Region
#Region "Functions"
		Public Shared Function CreateFromPoints(ByVal p1 As IEnumerable(Of Vector3)) As BoundingBox
			If (p1 Is Nothing) Then
				Throw New ArgumentNullException("Vector is empty")
			End If
			Dim flag As Boolean = False
			Dim v3 As New Vector3(Single.MaxValue)
			Dim v2 As New Vector3(Single.MinValue)
			Dim v1 As Vector3
			For Each vector In p1
				Dim v4 As Vector3 = v1
				Vector3.Min(v3, v4, v3)
				Vector3.Max(v2, v4, v2)
				flag = True
			Next
			If Not flag Then
				Throw New ArgumentException("Resulting Bounding Box has zero points")
			End If
			Return New BoundingBox(v3, v2)
		End Function
		Public Shared Function CreateMerged(ByVal orig As BoundingBox, ByVal addit As BoundingBox) As BoundingBox
			Dim box As BoundingBox
			Vector3.Min((orig.Min), (addit.Min), box.Min)
			Vector3.Max((orig.Max), (addit.Max), box.Max)
			Return box
		End Function
		Public Function Contains(ByVal b1 As BoundingBox) As ContainmentType
			If ((Me.Max.X < b1.Min.X) OrElse (Me.Min.X > b1.Max.X)) Then
				Return ContainmentType.Disjoint
			End If
			If ((Me.Max.Y < b1.Min.Y) OrElse (Me.Min.Y > b1.Max.Y)) Then
				Return ContainmentType.Disjoint
			End If
			If ((Me.Max.Z < b1.Min.Z) OrElse (Me.Min.Z > b1.Max.Z)) Then
				Return ContainmentType.Disjoint
			End If
			If ((((Me.Min.X <= b1.Min.X) AndAlso (b1.Max.X <= Me.Max.X)) AndAlso ((Me.Min.Y <= b1.Min.Y) AndAlso (b1.Max.Y <= Me.Max.Y))) AndAlso ((Me.Min.Z <= b1.Min.Z) AndAlso (b1.Max.Z <= Me.Max.Z))) Then
				Return ContainmentType.Contains
			End If
			Return ContainmentType.Intersects
		End Function
		Public Function Contains(ByVal f1 As BoundingFrustrum) As ContainmentType
			If (Nothing Is f1) Then
				Throw New ArgumentNullException("Frustum has no value")
			End If
			If Not f1.Intersects(Me) Then
				Return ContainmentType.Disjoint
			End If
			Dim v1 As Vector3
			For Each v1 In f1.cornerArray
				If (Me.Contains(v1) = ContainmentType.Disjoint) Then
					Return ContainmentType.Intersects
				End If
			Next
			Return ContainmentType.Contains
		End Function
		Public Function Contains(ByVal p1 As Vector3) As ContainmentType
			If ((((Me.Min.X <= p1.X) AndAlso (p1.X <= Me.Max.X)) AndAlso ((Me.Min.Y <= p1.Y) AndAlso (p1.Y <= Me.Max.Y))) AndAlso ((Me.Min.Z <= p1.Z) AndAlso (p1.Z <= Me.Max.Z))) Then
				Return ContainmentType.Contains
			End If
			Return ContainmentType.Disjoint
		End Function
		Public Function Contains(ByVal s1 As BoundingSphere) As ContainmentType
			Dim num2 As Single
			Dim v1 As Vector3
			Vector3.Clamp((s1.Center), (Me.Min), (Me.Max), v1)
            Vector3.DistanceSquared(s1.center),(v1),num2)
			Dim radius As Single = s1.Radius
			If (num2 > (radius * radius)) Then
				Return ContainmentType.Disjoint
			End If
			If (((((Me.Min.X + radius) <= s1.Center.X) AndAlso (s1.Center.X <= (Me.Max.X - radius))) AndAlso (((Me.Max.X - Me.Min.X) > radius) AndAlso ((Me.Min.Y + radius) <= s1.Center.Y))) AndAlso (((s1.Center.Y <= (Me.Max.Y - radius)) AndAlso ((Me.Max.Y - Me.Min.Y) > radius)) AndAlso ((((Me.Min.Z + radius) <= s1.Center.Z) AndAlso (s1.Center.Z <= (Me.Max.Z - radius))) AndAlso ((Me.Max.X - Me.Min.X) > radius)))) Then
				Return ContainmentType.Contains
			End If
			Return ContainmentType.Intersects
		End Function
		Public Function Intersects(ByVal b1 As BoundingBox) As Boolean
			If ((Me.Max.X < b1.Min.X) OrElse (Me.Min.X > b1.Max.X)) Then
				Return False
			End If
			If ((Me.Max.Y < b1.Min.Y) OrElse (Me.Min.Y > b1.Max.Y)) Then
				Return False
			End If
			Return ((Me.Max.Z >= b1.Min.Z) AndAlso (Me.Min.Z <= b1.Max.Z))
		End Function
		Public Function Intersects(ByVal f1 As BoundingFrustrum) As Boolean
			If (Nothing Is f1) Then
				Throw New ArgumentNullException("Frustrum has no value")
			End If
			Return f1.Intersects(Me)
		End Function
		Public Function Intersects(ByVal p1 As Plane) As PlaneIntersectionType
			Dim v1 As Vector3
			Dim v2 As Vector3
			v2.X = IIf((p1.Normal.X >= 0.0!), Me.Min.X, Me.Max.X)
			v2.Y = IIf((p1.Normal.Y >= 0.0!), Me.Min.Y, Me.Max.Y)
			v2.Z = IIf((p1.Normal.Z >= 0.0!), Me.Min.Z, Me.Max.Z)
			v1.X = IIf((p1.Normal.X >= 0.0!), Me.Max.X, Me.Min.X)
			v1.Y = IIf((p1.Normal.Y >= 0.0!), Me.Max.Y, Me.Min.Y)
			v1.Z = IIf((p1.Normal.Z >= 0.0!), Me.Max.Z, Me.Min.Z)
			Dim num As Single = (((p1.Normal.X * v2.X) + (p1.Normal.Y * v2.Y)) + (p1.Normal.Z * v2.Z))
			If ((num + p1.D) > 0.0!) Then
				Return PlaneIntersectionType.Front
			End If
			num = (((p1.Normal.X * v1.X) + (p1.Normal.Y * v1.Y)) + (p1.Normal.Z * v1.Z))
			If ((num + p1.D) < 0.0!) Then
				Return PlaneIntersectionType.Back
			End If
			Return PlaneIntersectionType.Intersecting
		End Function
		Public Function Intersects(ByVal r1 As Ray) As Single?
			Dim num As Single = 0.0!
			Dim maxValue As Single = Single.MaxValue
			If (Abs(r1.direction.x) < 0.000001!) Then
				If ((r1.position.x < Me.Min.X) OrElse (r1.position.x > Me.Max.X)) Then
					Return Nothing
				End If
			Else
				Dim num11 As Single = (1.0! / r1.direction.x)
				Dim num8 As Single = ((Me.Min.X - r1.position.x) * num11)
				Dim num7 As Single = ((Me.Max.X - r1.position.x) * num11)
				If (num8 > num7) Then
					Dim num14 As Single = num8
					num8 = num7
					num7 = num14
				End If
				num = MathHelper.Max(num8, num)
				maxValue = MathHelper.min(num7, maxValue)
				If (num > maxValue) Then
					Return Nothing
				End If
			End If
			If (Abs(r1.direction.y) < 0.000001!) Then
				If ((r1.position.y < Me.Min.Y) OrElse (r1.position.y > Me.Max.Y)) Then
					Return Nothing
				End If
			Else
				Dim num10 As Single = (1.0! / r1.direction.y)
				Dim num6 As Single = ((Me.Min.Y - r1.position.y) * num10)
				Dim num5 As Single = ((Me.Max.Y - r1.position.y) * num10)
				If (num6 > num5) Then
					Dim num13 As Single = num6
					num6 = num5
					num5 = num13
				End If
				num = MathHelper.max(num6, num)
				maxValue = MathHelper.min(num5, maxValue)
				If (num > maxValue) Then
					Return Nothing
				End If
			End If
			If (Abs(r1.direction.z) < 0.000001!) Then
				If ((r1.position.z < Me.Min.Z) OrElse (Ray.position.z > Me.Max.Z)) Then
					Return Nothing
				End If
			Else
				Dim num9 As Single = (1.0! / r1.direction.z)
				Dim num4 As Single = ((Me.Min.Z - r1.position.z) * num9)
				Dim num3 As Single = ((Me.Max.Z - r1.position.z) * num9)
				If (num4 > num3) Then
					Dim num12 As Single = num4
					num4 = num3
					num3 = num12
				End If
				num = MathHelper.max(num4, num)
				maxValue = MathHelper.min(num3, maxValue)
				If (num > maxValue) Then
					Return Nothing
				End If
			End If
			Return New Single?(num)
		End Function
		Public Function Intersects(ByVal s1 As BoundingSphere) As Boolean
			Dim num As Single
			Dim v1 As Vector3
			Vector3.Clamp((s1.Center), (Me.Min), (Me.Max), v1)
			Vector3.DistanceSquared((s1.Center), (v1), num)
			Return (num <= (s1.Radius * s1.Radius))
		End Function
		Public Overrides Function ToString() As String
			Return String.Format(CultureInfo.CurrentCulture, "(Min:{0};Max:{1})", New Object() {Me.Min.ToString, Me.Max.ToString})
		End Function
		Public Shadows Function Equals(ByVal other As BoundingBox) As Boolean Implements System.IEquatable(Of BoundingBox).Equals
			Return ((Me.Min = other.Min) AndAlso (Me.Max = other.Max))
		End Function
#End Region
	End Structure
	''' <summary>
	''' needs coding
	''' </summary>
	''' <remarks></remarks>
	Public Structure BoundingSphere
		Implements IEquatable(Of BoundingSphere)
#Region "Variables"
		Public Center As Vector3
		Public Radius As Single
#End Region
#Region "Constructors"
		Public Sub New(ByVal c1 As Vector3, ByVal rad As Single)

		End Sub
#End Region
#Region "Methods"
		Public Shared Sub CreateFromBoundingBox(ByVal b1 As BoundingBox, ByVal b2 As BoundingSphere)

		End Sub
		Public Shared Sub CreateMerged(ByVal orig As BoundingSphere, ByVal addit As BoundingSphere, <Out()> ByRef b1 As BoundingSphere)

		End Sub
		Public Sub Contains(ByVal b1 As BoundingBox, <Out()> ByRef result As ContainmentType)

		End Sub
		Public Sub Contains(ByVal p1 As Vector3, <Out()> ByRef result As ContainmentType)

		End Sub
		Public Sub Contains(ByVal s1 As BoundingSphere, <Out()> ByRef result As ContainmentType)

		End Sub
		Public Sub Intersects(ByVal b1 As BoundingBox, <Out()> ByRef result As Boolean)

		End Sub
		Public Sub Intersects(ByVal p1 As Plane, <Out()> ByRef result As PlaneIntersectionType)

		End Sub
		Public Sub Intersects(ByVal r1 As Ray, <Out()> ByRef result As Single?)

		End Sub
		Public Sub Intersects(ByVal s1 As BoundingSphere, <Out()> ByRef result As Boolean)

		End Sub
		Public Sub Transform(ByVal m1 As Matrix, <Out()> ByRef s1 As BoundingSphere)

		End Sub
		Friend Sub SupportMapping(ByVal v1 As Vector3, <Out()> ByRef result As Vector3)

		End Sub
#End Region
#Region "Functions"
		Public Shared Function CreateFromBoundingBox(ByVal b1 As BoundingBox) As BoundingSphere

		End Function
		Public Shared Function CreateFromPoints(ByVal p1 As IEnumerable(Of Vector3)) As BoundingSphere

		End Function
		Public Shared Function CreateFromFrustum(ByVal f1 As BoundingFrustrum) As BoundingSphere

		End Function
		Public Shared Function CreateMerged(ByVal orig As BoundingSphere, ByVal addit As BoundingSphere) As BoundingSphere

		End Function
		Public Function Intersects(ByVal b1 As BoundingBox) As Boolean

		End Function
		Public Function Intersects(ByVal f1 As BoundingFrustrum) As Boolean

		End Function
		Public Function Intersects(ByVal p1 As Plane) As PlaneIntersectionType

		End Function
		Public Function Intersects(ByVal r1 As Ray) As Single?

		End Function
		Public Function Intersects(ByVal s1 As BoundingSphere) As Boolean

		End Function
		Public Function Contains(ByVal b1 As BoundingBox) As ContainmentType

		End Function
		Public Function Contains(ByVal f1 As BoundingFrustrum) As ContainmentType

		End Function
		Public Function Contains(ByVal p1 As Vector3) As ContainmentType

		End Function
		Public Function Contains(ByVal s1 As BoundingSphere) As ContainmentType

		End Function
		Public Function Transform(ByVal m1 As Matrix) As BoundingSphere

		End Function
		Public Shadows Function Equals(ByVal other As BoundingSphere) As Boolean Implements System.IEquatable(Of BoundingSphere).Equals

		End Function
		Public Overrides Function ToString() As String

		End Function
#End Region
	End Structure

End Namespace
Namespace sl3game

End Namespace